Repository navigation
Conversation
commit: |
Code Review by Qodo
1. Shutdown spins on a released runner
|
|
Following up on this shutdown fix when someone has time to review. It brings CockroachDB's runner-release loop in line with PostgresDriver: releasing a runner mutates the array being iterated, so the current map() can skip a runner and leave destroy() waiting indefinitely. The regression reproduces the hang against CockroachDB and passes with the fix. CI on the current PR head is green, including the CockroachDB jobs, and GitHub reports no merge conflicts, though the branch is behind master. Is there anything else you would like covered before review? |
Description of change
Fixes #12890.
Calling
DataSource.destroy()with two connected CockroachDB query runners hangs even when both queries have finished.closePool()maps overconnectedQueryRunners, but eachrelease()splices itself from that array synchronously. The second runner is skipped, sopool.end()waits for a connection that shutdown never returns.Use the same release loop already adopted by
PostgresDriverin #7596. Extend that PR's existing #6958 regression test to run against CockroachDB as well. This keeps the current policy of releasing tracked runners before closing the pool; it adds no shutdown options or public API changes.Validation
Tested against live CockroachDB v25.2.23 in Docker, using Node.js v22.17.1, pg 8.23.0 and pg-pool 3.14.0:
destroy(); teardown then reports that the pool was already ending.pnpm run packagepass.git diff --checkpass.The full CockroachDB suite was started locally but stopped because schema setup was progressing slowly. No failures had been reported at that point; this is not a full-suite pass. The full multi-driver matrix remains for CI.
Pull-Request Checklist
masterbranch