docintelapp / DocIntel

Open Source Platform for storing, organizing, and searching documents related to cyber threats
https://docintel.org
Other
154 stars 25 forks source link

Postgresql Locks Timeouts #52

Closed xme closed 1 year ago

xme commented 1 year ago

I built new containers based on the main branch (synced on 20/02/2023) and now most containers fail with the following error:

docintel-dev-scraper            | Unhandled exception. System.TimeoutException: Timeout exceeded when trying to acquire the lock
docintel-dev-scraper            |    at Medallion.Threading.Internal.DistributedLockHelpers.ThrowTimeoutIfNull[T](ValueTask`1 task, String object) in /_/DistributedLock.Core/Internal/DistributedLockHelpers.cs:line 142
docintel-dev-scraper            |    at RunMethodsSequentially.LockAndRunCode.PostgreSqlLockAndRunJob.LockAndRunMethodsAsync(IServiceProvider serviceProvider)
docintel-dev-scraper            |    at RunMethodsSequentially.LockAndRunCode.GetLockAndThenRunServices.LockAndLoadAsync()
docintel-dev-scraper            |    at RunMethodsSequentially.LockAndRunCode.GetLockAndThenRunHostedService.StartAsync(CancellationToken cancellationToken)
docintel-dev-scraper            |    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
docintel-dev-scraper            |    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
docintel-dev-scraper            |    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
docintel-dev-scraper            |    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
docintel-dev-scraper            |    at DocIntel.Services.Scraper.Program.Main(String[] args) in /src/DocIntel.Services.Scraper/Program.cs:line 33]([url](url))

Same error for all, related to Postgresql...

ancailliau commented 1 year ago

Fixed in main (changes to be pushed). The container could not connect to the synapse server, waiting for the server to be responsive. The other containers wait on the lock that is not released before the timeout.