You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 30000ms. Even when I set it (through Knex) lower, this issue still occurs with 10 second timeouts and clearly seems to originate from pg-pool and not Tarn.
My expectation was that changing idleTimeoutMillis in our Test environment would impact these timeouts. Interestingly, node-postgres recently added a (false defaulted) config to allowExitOnIdle which feels like it could be useful here but I can't set it through Knex/Tarn since it's not allowed by the PoolConfig 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:
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 allowExitOnIdle parameter support needs to be also implemented in knex.
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: