Skip to content

Fix dev-db socket server slot leak and add a wedge watchdog - #1744

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/devdb-socket-handler-leak
Aug 25, 2026
Merged

Fix dev-db socket server slot leak and add a wedge watchdog#1744
RhysSullivan merged 1 commit into
mainfrom
fix/devdb-socket-handler-leak

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Kills the last recurring CI e2e flake family: mid-shard the cloud dev DB stops answering new connections (every later test dies with cloud signIn: callback set no session (500) / CONNECT_TIMEOUT 127.0.0.1:<db-port>), most recently in run 32897502744 (cloud 6of16).

Two changes:

  • Slot leak in the patched pglite-socket server. A server-initiated teardown (the idle backstop) detaches the socket after removing its listeners, so the server's close bookkeeping never runs and the reaped handler stays in the handlers set forever — one maxConnections slot burned per reap, until every new connection is answered with "Too many connections" while the process, port, and PGlite are all healthy. The handler is now dropped when it dispatches its terminal error. Regression test: reaped handlers release their connection slots (fails against the unpatched server).
  • Wedge watchdog in dev-db. Each front-end wedge so far has found a new path, and one wedge fails every remaining test in the shard. dev-db now probes itself the way the app connects (fresh TCP + startup + select 1); after 3 consecutive failures it logs the server's stats to the boot log, swaps in a fresh socket server on the same PGlite (state lives in PGlite; the front-end is stateless), and exits non-zero if restarts don't restore service so the boot supervisor reports an attributable cause instead of minutes of anonymous timeouts.

Checks: lint, typecheck, dev-db-socket-concurrency.node.test.ts (6/6), manual watchdog exercise (healthy boot silent; forced wedge → 3 probe failures → stats dump → bounded restarts).

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 7ac8253 Commit Preview URL

Branch Preview URL
Aug 25 2026, 09:30 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1744

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1744

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1744

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1744

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1744

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1744

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1744

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1744

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1744

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1744

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1744

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1744

executor

npm i https://pkg.pr.new/executor@1744

commit: 7ac8253

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 7ac8253 Aug 25 2026, 09:32 PM

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 25, 2026 22:52
@RhysSullivan
RhysSullivan merged commit 1bbd47e into main Aug 25, 2026
44 checks passed
@RhysSullivan
RhysSullivan deleted the fix/devdb-socket-handler-leak branch August 25, 2026 22:52
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.

1 participant