Open langpavel opened 6 months ago
May not be the same issue, but we're also seeing client.end()
not working/allowing nodejs to exit gracefully. When we search through for the open handles, it points to this:
# PBKDF2REQUEST
node:internal/async_hooks:202
node:internal/crypto/pbkdf2:65
/node_modules/.pnpm/postgres@3.4.4/node_modules/postgres/cjs/src/connection.js:691 - const saltedPassword = await crypto.pbkdf2Sync(
node:internal/process/task_queues:95
If #869 gets fixed, you might not need to call client.end() or sql.end().
It's an interesting proposal, but that wouldn't fix the underlying issue here as this seems to be a resource/memory leak.
Say I ran a fleet of databases and scripted some administration across the fleet, the node process would consume more and more memory as it processed each database rather than freeing it up when end()
is called.
Hello. I discovered race condition with
sql.end()
.It seems that if there are more queries queued than max pool size, something hangs.
I'm running on deno 1.43.1 with postgres.js v3.4.4
When
CLOSE_POOL_TIMEOUT
is around 33, there is 50/50 chance of both conditions below. IfCLOSE_POOL_TIMEOUT
is much greater, process will hang. IfCLOSE_POOL_TIMEOUT
is lesser, process will exit normally.The output is as follows: First run, OK, finished successfully :+1:
Second run does not ternimate. :face_with_head_bandage: