Skip to content

fix(cloudflare): Use original waitUntil to not create a deadlock#21197

Open
JPeer264 wants to merge 1 commit into
developfrom
jp/fix-waituntil-deadlock
Open

fix(cloudflare): Use original waitUntil to not create a deadlock#21197
JPeer264 wants to merge 1 commit into
developfrom
jp/fix-waituntil-deadlock

Conversation

@JPeer264
Copy link
Copy Markdown
Member

follow up to: #21156

This prevents a deadlock in the waitUntil, which happened in the sentry-mcp:

Screenshot 2026-05-27 at 17 04 19

@JPeer264 JPeer264 requested a review from a team May 27, 2026 15:04
@JPeer264 JPeer264 self-assigned this May 27, 2026
@JPeer264 JPeer264 requested a review from a team as a code owner May 27, 2026 15:04
@JPeer264 JPeer264 requested review from andreiborza, mydea and s1gr1d and removed request for a team May 27, 2026 15:04
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6da5af9. Configure here.


type FlushLockRegistry = {
readonly locks: Set<FlushLockInternal>;
readonly originalWaitUntil: ExecutionContext['waitUntil'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused originalWaitUntil field on FlushLockRegistry

Low Severity

The new originalWaitUntil field on FlushLockRegistry is stored in the registry object but never read from it — only registry.locks is ever accessed. The actual original-waitUntil lookup goes through the separate originalWaitUntilMap WeakMap. This makes the field dead code, storing a redundant reference that adds confusion about which mechanism is authoritative for retrieving the original function.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6da5af9. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.27 kB - -
@sentry/browser - with treeshaking flags 25.69 kB - -
@sentry/browser (incl. Tracing) 45.25 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.49 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.23 kB - -
@sentry/browser (incl. Tracing, Replay) 84.86 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.36 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.57 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.18 kB - -
@sentry/browser (incl. Feedback) 44.46 kB - -
@sentry/browser (incl. sendFeedback) 32.09 kB - -
@sentry/browser (incl. FeedbackAsync) 37.21 kB - -
@sentry/browser (incl. Metrics) 28.37 kB - -
@sentry/browser (incl. Logs) 28.59 kB - -
@sentry/browser (incl. Metrics & Logs) 29.29 kB - -
@sentry/react 29.01 kB - -
@sentry/react (incl. Tracing) 47.49 kB - -
@sentry/vue 32.19 kB - -
@sentry/vue (incl. Tracing) 47.12 kB - -
@sentry/svelte 27.3 kB - -
CDN Bundle 29.68 kB - -
CDN Bundle (incl. Tracing) 47.78 kB - -
CDN Bundle (incl. Logs, Metrics) 31.17 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.03 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.48 kB - -
CDN Bundle (incl. Tracing, Replay) 85.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.43 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.15 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.31 kB - -
CDN Bundle - uncompressed 87.69 kB - -
CDN Bundle (incl. Tracing) - uncompressed 144.15 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.18 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.91 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 216.91 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.67 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.62 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.36 kB - -
@sentry/nextjs (client) 49.98 kB - -
@sentry/sveltekit (client) 45.73 kB - -
@sentry/core/server 76.42 kB - -
@sentry/core/browser 63.17 kB - -
@sentry/node-core 62.25 kB - -
@sentry/node 130.74 kB +0.01% +3 B 🔺
@sentry/node - without tracing 74.7 kB - -
@sentry/aws-serverless 86.91 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 172.55 kB +0.08% +129 B 🔺
@sentry/cloudflare (withSentry) 431.1 kB +0.1% +420 B 🔺

View base workflow run

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