-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Curious behavior with idle timeouts (Postgres) #73
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
I think since tarn does not depend from knex nor posgresql, this should be knex issue. Knex creates internally tarn pool and adds necessary handlers to create/destroy resources etc. Usually if CI hangs after mocha exists, there are some timers etc. still running. Maybe you did not call knex.destroy() when CI is tearing down? Adding that Closing, since this does not seem to be tarn issue. |
We're using Knex 0.95.15 with tarn 3.0.2 and noticed some of our CI runs are hanging for many seconds past mocha's exit. After adding wtfnode to investigate we see the following open handles and timers running past the end of our test suite:
There's very likely something I missed here, but this doesn't feel right since the Tarn idleTimeoutMillis defaults to
30000
ms. Even when I set it (through Knex) lower, this issue still occurs with 10 second timeouts and clearly seems to originate frompg-pool
and not Tarn.There's a section in Knex'
PoolConfig
types that explicitly references Tarn configs in a way that appears separate from the rest of the PoolConfig interface, which makes me curious.My expectation was that changing
idleTimeoutMillis
in our Test environment would impact these timeouts. Interestingly, node-postgres recently added a (false defaulted) config toallowExitOnIdle
which feels like it could be useful here but I can't set it through Knex/Tarn since it's not allowed by thePoolConfig
interface.Despite looking into this for quite a while now I can't quite seem to find where Knex/Tarn interact with node-postgres and where these configs would be clashing. I'd be grateful if anyone has pointers, and hopefully someone encountering similar issues can benefit from my research. 🙃
The text was updated successfully, but these errors were encountered: