Skip to content

Stabilize PgPool acquireTimeout tests under load - #9744

Closed
tim-smart wants to merge 39 commits into
v4/next-minorfrom
fix/pgpool-acquire-timeout-test-setup
Closed

tim-smart wants to merge 39 commits into
v4/next-minorfrom
fix/pgpool-acquire-timeout-test-setup

Conversation

@tim-smart

Copy link
Copy Markdown
Contributor

The two acquireTimeout tests in PgPool.in-process.test.ts open their first socket inside a checkout bounded by the 100ms acquireTimeout. Under load, cold socket startup takes 40 to 490ms on Bun, so the timeout sometimes fires during setup, before the scenario under test starts.

Both tests now set minConnections: 1 and poll sql.poolStats until an idle connection exists before reserving the connection or forking SELECT 1. Background creation isn't bound by acquireTimeout. The wait gives up after about 5s and fails with the last pool stats. The timeout assertions and write counts are unchanged, and nothing in src changed.

Validation on Bun 1.4.0 (the CI version), 72 runs of the file at 12 concurrent processes:

  • base ee781bbddd: 10/72 runs failed (8 exhausted-pool, 3 multiplexed)
  • this branch: 0/72

The file also passes 5/5 runs under Node.

Any change to how acquireTimeout relates to connectTimeout in production code belongs in a separate PR.

Closes EFF-2768

fubhy and others added 30 commits October 21, 2026 22:07
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Sebastian Lorenz <fubhy@fubhy.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Stéphane Le Dorze <stephane.ledorze@gmail.com>
Co-authored-by: Tarekkharsa <47394961+Tarekkharsa@users.noreply.github.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Viacheslav <bezff@MacBook-Pro-3.local>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Jem Gold <jem@portola.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Juliaan <76615135+schutzelaars@users.noreply.github.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
…ollapse options (#9276)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim <hello@timsmart.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
)

Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Viacheslav <bezff@MacBook-Pro-3.local>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
@effect-bot
effect-bot force-pushed the v4/next-minor branch 3 times, most recently from ed5e85c to 1b0f32b Compare October 21, 2026 22:39
@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 39.18 KB 39.18 KB 0.00 KB (0.00%)
basic.ts 7.08 KB 7.08 KB 0.00 KB (0.00%)
batching.ts 10.95 KB 10.95 KB 0.00 KB (0.00%)
brand.ts 6.71 KB 6.71 KB 0.00 KB (0.00%)
cache.ts 11.39 KB 11.39 KB 0.00 KB (0.00%)
config.ts 22.55 KB 22.55 KB 0.00 KB (0.00%)
differ.ts 21.70 KB 21.70 KB 0.00 KB (0.00%)
http-client.ts 26.47 KB 26.47 KB 0.00 KB (0.00%)
http-router.ts 35.74 KB 35.74 KB 0.00 KB (0.00%)
logger.ts 11.73 KB 11.73 KB 0.00 KB (0.00%)
metric.ts 9.32 KB 9.32 KB 0.00 KB (0.00%)
optic.ts 6.93 KB 6.93 KB 0.00 KB (0.00%)
pubsub.ts 15.83 KB 15.83 KB 0.00 KB (0.00%)
queue.ts 12.65 KB 12.65 KB 0.00 KB (0.00%)
schedule.ts 11.63 KB 11.63 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 13.89 KB 13.89 KB 0.00 KB (0.00%)
schema-binary.ts 40.71 KB 40.71 KB 0.00 KB (0.00%)
schema-class.ts 21.41 KB 21.41 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 32.37 KB 32.37 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 27.57 KB 27.57 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.13 KB 15.13 KB 0.00 KB (0.00%)
schema-string.ts 12.14 KB 12.14 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.07 KB 16.07 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 38.70 KB 38.70 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 25.80 KB 25.80 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 20.63 KB 20.63 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 20.82 KB 20.82 KB 0.00 KB (0.00%)
schema-toFormatter.ts 20.92 KB 20.92 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 25.51 KB 25.51 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 20.92 KB 20.92 KB 0.00 KB (0.00%)
schema.ts 20.59 KB 20.59 KB 0.00 KB (0.00%)
stm.ts 13.93 KB 13.93 KB 0.00 KB (0.00%)
stream.ts 10.18 KB 10.18 KB 0.00 KB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.