Skip to content

Probe connection health through a per-connection atom - #2071

Merged
RhysSullivan merged 3 commits into
mainfrom
e2e/health-probe-churn
Sep 19, 2026
Merged

RhysSullivan merged 3 commits into
mainfrom
e2e/health-probe-churn

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes the client-side health-probe churn seen in production on 2026-09-18, and adds a browser scenario that reproduces it.

Symptom

One signed-in browser with many non-healthy connections sent hundreds of /api/connections/.../health POSTs and /api/connections GETs per minute for as long as the dashboard stayed open. Most were aborted client-side, but hundreds per minute reached the server and upstreams. The server annotated every verdict as unchanged.

Cause

checkConnectionHealth is one shared mutation atom. useAtomSet(..., { mode: "promiseExit" }) calls registry.set and then awaits that atom's next settled result. The health hook fires one probe per list row in a loop, so each call interrupts the previous one and every row's promise resolves with the last row's verdict. Rows compare a foreign verdict against their own persisted status, see a change, refresh the connections cache, and re-probe.

Fix

checkConnectionHealthFor(address): an Atom.family of per-connection probe atoms. The hooks set and await the connection's own atom, so each probe has its own fiber and its own result. Manual "Check now" keeps its reactivity keys.

Evidence

e2e/scenarios/health-probe-churn.test.ts: 8 integrations, 4 with a probe that reads degraded, 4 with none (unknown), verdicts persisted before the browser opens, one mount of the integrations list.

Before After
Health POSTs sent 28 8
Connections-list GETs sent 17 2
Aborted client-side 34 0

connection-health-verdict.test.ts still passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026

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 9ca6f34 Commit Preview URL

Branch Preview URL
Sep 19 2026, 04:49 AM

@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026

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 9ca6f34 Sep 19 2026, 04:49 AM

@pkg-pr-new

pkg-pr-new Bot commented Sep 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

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

@executor-js/config

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

@executor-js/execution

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

@executor-js/sdk

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

@executor-js/codemode-core

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

@executor-js/runtime-quickjs

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

@executor-js/plugin-file-secrets

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

@executor-js/plugin-graphql

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

@executor-js/plugin-keychain

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

@executor-js/plugin-mcp

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

@executor-js/plugin-onepassword

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

@executor-js/plugin-openapi

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

executor

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

commit: 9ca6f34

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@RhysSullivan RhysSullivan changed the title e2e: reproduce health-probe churn on the integrations list Probe connection health through a per-connection atom Sep 19, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@RhysSullivan
RhysSullivan marked this pull request as ready for review September 19, 2026 04:54
@RhysSullivan
RhysSullivan merged commit 09c19e4 into main Sep 19, 2026
44 checks passed
@RhysSullivan
RhysSullivan deleted the e2e/health-probe-churn branch September 19, 2026 04:54
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