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
{{ message }}
Repository navigation
connector-wake alerts: skip Durable Object retirement close errors - #50149
Every few hours Cloudflare retires the Durable Objects behind the connector wake service. Each open socket on a retired object gets a close event, and Cloudflare reports that event as an exception even though the desktop reconnects in about a second. Those reports were tripping the wake cloudflare-errors alert. The wake alert now leaves those socket-event exceptions out and still counts every other error.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$25
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$25
Prod
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$22
$\color{#cf222e}{\Huge{\mathbf{−}}}$9
$\color{#1a7f37}{\Huge{\mathbf{+}}}$13
What Changed
relay-edge/src/alerts-cloudflare.ts: the Durable Object GraphQL query also groups by the documented type dimension (hibernation / http / jsrpc). cloudflareErrors takes an optional { skipHibernationErrors }. When it is set, a failing hibernation invocation still counts as an invocation but not as an error.
connector-wake/src/alerts.ts: the wake alerts pass skipHibernationErrors: true. The relay edge does not pass it, so its alert is unchanged.
One unit test with both kinds of error: a retirement-shaped burst of failing hibernation events stays quiet, and object jsrpc/http errors still fire.
Why
Read-only checks against Cloudflare's GraphQL data for 11-24 to 11-26:
Every exception in the retirement waves is a Durable Object invocation with type=hibernation and status=scriptThrewException. There were 142 in 10:00 to 11:00 UTC on 11-26, 175 in 15:45 to 16:15, and 159 in the 18:00 hour.
The live tail shows these are close events (code 1006) that end in "this Durable Object instance is no longer active". The runtime throws this, not our handler.
Durable Object http/jsrpc errors and Worker fetch errors show up separately (Worker errors were 41 in 15:45 to 16:15 and 294 in the 11-25 17:00 hour). They keep counting.
Trade-off: the dataset has no event subtype, close code or message. So an exception thrown by our own webSocketMessage/webSocketClose/webSocketError is left out too. Those handlers are three short functions, and the wake rules that read Analytics Engine (wake-errors, reconnect-surge, no-socket-share) still catch the effect on users. Raising the threshold instead would also hide real Worker errors.
Linked Issue
N/A (internal alert tuning).
Visual Proof
N/A: alerts Worker only, no UI.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
vitest run test/alerts.test.ts in cloud/apps/connector-wake: 33 passed. The new test fails when skipHibernationErrors is false.
tsc --noEmit in connector-wake passes. relay-edge shows no errors in its own files.
Ran the GraphQL query with the new type dimension against production data to confirm the field and its values.
Performance
None, because this adds one dimension to a GraphQL query the alerts cron already sends every 5 minutes, which returns a handful more groups.
Risk
Level: Low
Only the wake alerts Worker changes behaviour, and only for the cloudflare-errors rule. The worst case is that a bug in the wake socket handlers no longer pages through this rule. Revert with a plain revert. Deploying needs the usual orca-cloud pin bump; alerts.jsonc needs no change.
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
Cloudflare Durable Object queries now include each invocation group’s type and filter groups by configured namespace IDs. The tally can exclude hibernation requests from error counts while retaining them in invocation totals. connector-wake enables this option. Tests verify that hibernation exceptions are excluded and that jsrpc exceptions and http internal errors count toward alerts.
Merge Risk: Minimal · up to 3476f
The connector-wake Cloudflare error alert now excludes failing hibernation Durable Object invocations from its error count while still counting them as invocations. The earlier concern about the query's 200-group cap is addressed by filtering to the configured namespaces on the Cloudflare side. Other Durable Object errors, Worker errors, and the relay-edge alert behave as before. No actionable merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the connector-wake alerts and the Durable Object retirement close errors being skipped. The change excludes hibernation scriptThrewException counts from the cloudflare-errors alert, wh…
Description check
The description follows the template well. It has the ELI5, What Changed, Why, Testing, Performance, Risk, and Checklist sections, and it explains the trade-off clearly. The Linked Issue section says …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the connector-wake alerts and the Durable Object retirement close errors being skipped. The change excludes hibernation scriptThrewException counts from the cloudflare-errors alert, which matches the title's subject. The title is specific and short, though 'retirement close errors' is slightly narrower than the change, which also adds a type dimension to the GraphQL query and an option in relay-edge.
Full details: Description check
Explanation
The description follows the template well. It has the ELI5, What Changed, Why, Testing, Performance, Risk, and Checklist sections, and it explains the trade-off clearly. The Linked Issue section says N/A (internal alert tuning), which the template does not allow for outside contributors, but the author may be a maintainer. The Visual Proof section gives a reason for N/A. The Risk level is set to Low. The AI Disclosure section is empty, and the Review section has no content. The Performance section finishes the required sentence. The Testing section lists the required items. Most required information is present.
Resolution
Optionally fill in the empty AI Disclosure and Review sections, and confirm the Linked Issue exemption applies to this author.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 4dbbb49a-7375-4e6b-95ca-245555e516b6
Commits
Reviewing files that changed from the base of the PR and between 21208f3 and 3476f6f.
Files selected for processing: 2
cloud/apps/connector-wake/test/alerts.test.ts
cloud/apps/relay-edge/src/alerts-cloudflare.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ccab4154-a14e-4146-909e-7e2ea2027fee
Commits
Reviewing files that changed from the base of the PR and between 5d299f8 and 21208f3.
Files selected for processing: 3
cloud/apps/connector-wake/src/alerts.ts
cloud/apps/connector-wake/test/alerts.test.ts
cloud/apps/relay-edge/src/alerts-cloudflare.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Every few hours Cloudflare retires the Durable Objects behind the connector wake service. Each open socket on a retired object gets a close event, and Cloudflare reports that event as an exception even though the desktop reconnects in about a second. Those reports were tripping the wake
cloudflare-errorsalert. The wake alert now leaves those socket-event exceptions out and still counts every other error.What Changed
relay-edge/src/alerts-cloudflare.ts: the Durable Object GraphQL query also groups by the documentedtypedimension (hibernation/http/jsrpc).cloudflareErrorstakes an optional{ skipHibernationErrors }. When it is set, a failinghibernationinvocation still counts as an invocation but not as an error.connector-wake/src/alerts.ts: the wake alerts passskipHibernationErrors: true. The relay edge does not pass it, so its alert is unchanged.hibernationevents stays quiet, and objectjsrpc/httperrors still fire.Why
Read-only checks against Cloudflare's GraphQL data for 11-24 to 11-26:
type=hibernationandstatus=scriptThrewException. There were 142 in 10:00 to 11:00 UTC on 11-26, 175 in 15:45 to 16:15, and 159 in the 18:00 hour.closeevents (code 1006) that end in "this Durable Object instance is no longer active". The runtime throws this, not our handler.http/jsrpcerrors and Workerfetcherrors show up separately (Worker errors were 41 in 15:45 to 16:15 and 294 in the 11-25 17:00 hour). They keep counting.Trade-off: the dataset has no event subtype, close code or message. So an exception thrown by our own
webSocketMessage/webSocketClose/webSocketErroris left out too. Those handlers are three short functions, and the wake rules that read Analytics Engine (wake-errors,reconnect-surge,no-socket-share) still catch the effect on users. Raising the threshold instead would also hide real Worker errors.Linked Issue
N/A (internal alert tuning).
Visual Proof
N/A: alerts Worker only, no UI.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
vitest run test/alerts.test.tsincloud/apps/connector-wake: 33 passed. The new test fails whenskipHibernationErrorsis false.tsc --noEmitinconnector-wakepasses.relay-edgeshows no errors in its own files.Ran the GraphQL query with the new
typedimension against production data to confirm the field and its values.Performance
None, because this adds one dimension to a GraphQL query the alerts cron already sends every 5 minutes, which returns a handful more groups.
Risk
Level: Low
Only the wake alerts Worker changes behaviour, and only for the
cloudflare-errorsrule. The worst case is that a bug in the wake socket handlers no longer pages through this rule. Revert with a plain revert. Deploying needs the usual orca-cloud pin bump;alerts.jsoncneeds no change.AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)