Skip to content

fix(core): Drop sampled-out errors before they take a promise buffer slot - #25751

Merged
logaretm merged 2 commits into
developfrom
awad/sample-errors-before-buffer
Oct 27, 2026
Merged

logaretm merged 2 commits into
developfrom
awad/sample-errors-before-buffer

Conversation

@logaretm

Copy link
Copy Markdown
Member

Since #22671 sampled-out errors run the whole event pipeline while holding a client buffer slot, so error bursts on Node fill it up and real errors get dropped as queue_overflow, fixed by dropping sampled-out errors right away when there is no ok session for them to update.

I added tests showing sampled-out errors no longer overflow the buffer without a session and still go through the pipeline when one exists.

…slot

Since errors are sampled after beforeSend, a sampled-out error ran the whole
event pipeline while holding a slot in the client's promise buffer. With an
async event processor (e.g. ContextLines on Node), a burst of errors filled
the buffer and dropped errors that would have been sent as queue_overflow.

The pipeline only matters for a sampled-out error when there is an ok session
it can update, so without one the error is now dropped right away.
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 5f923e0 (PR test merge using develop at 869b92c)

Against: 869b92c (develop) · base run #63667

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.02 kB +0.11% +32 B 🔺
@sentry/browser - with treeshaking flags 28.16 kB +0.1% +27 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.06 kB +0.1% +28 B 🔺
@sentry/browser (incl. Tracing) 52.21 kB +0.09% +43 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.22 kB +0.1% +47 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.14 kB +0.05% +25 B 🔺
@sentry/browser (incl. Tracing, Replay) 91.98 kB +0.02% +14 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.89 kB +0.05% +39 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.72 kB +0.03% +20 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.7 kB +0.03% +29 B 🔺
@sentry/browser (incl. Feedback) 47.58 kB +0.08% +34 B 🔺
@sentry/browser (incl. sendFeedback) 35.09 kB +0.1% +35 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.19 kB +0.08% +31 B 🔺
@sentry/browser (incl. Metrics) 31.04 kB +0.1% +30 B 🔺
@sentry/browser (incl. Logs) 31.32 kB +0.12% +37 B 🔺
@sentry/browser (incl. Metrics & Logs) 31.99 kB +0.14% +44 B 🔺
@sentry/react 31.84 kB +0.1% +31 B 🔺
@sentry/react (incl. Tracing) 54.52 kB +0.05% +27 B 🔺
@sentry/vue 38.17 kB +0.08% +29 B 🔺
@sentry/vue (incl. Tracing) 55.12 kB +0.02% +10 B 🔺
@sentry/svelte 30.04 kB +0.11% +31 B 🔺
@sentry/remix (Remix 3 client bundle) 57.24 kB +0.09% +46 B 🔺
CDN Bundle 31.79 kB +0.09% +28 B 🔺
CDN Bundle (incl. Tracing) 52.73 kB +0.05% +26 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.99 kB +0.12% +38 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 54.7 kB +0.09% +45 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.96 kB +0.05% +32 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.45 kB +0.06% +49 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.36 kB +0.04% +32 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.56 kB +0.03% +20 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.53 kB +0.04% +38 B 🔺
CDN Bundle - uncompressed 93.62 kB +0.12% +111 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 156.47 kB +0.08% +111 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.17 kB +0.12% +111 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.44 kB +0.07% +111 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.39 kB +0.05% +111 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.81 kB +0.05% +111 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.77 kB +0.04% +111 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.51 kB +0.04% +111 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 296.46 kB +0.04% +111 B 🔺
@sentry/nextjs (client) 57.42 kB +0.07% +38 B 🔺
@sentry/sveltekit (client) 52.56 kB +0.03% +11 B 🔺
@sentry/core/server 43.66 kB +0.09% +35 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 154 kB +0.03% +42 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB - -
@sentry/node - without tracing 95.52 kB +0.05% +40 B 🔺
@sentry/node - without channel injection 134.66 kB +0.03% +28 B 🔺
@sentry/aws-serverless 103.69 kB +0.05% +43 B 🔺
@sentry/cloudflare (withSentry) - minified 197.4 kB +0.08% +143 B 🔺
@sentry/cloudflare (withSentry) 490.4 kB +0.08% +349 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 217.98 kB +0.07% +139 B 🔺

View base workflow run

@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7df9aa3. Configure here.

@logaretm
logaretm marked this pull request as ready for review October 27, 2026 02:48
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 3 not successful, 59 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 34s Details
❌ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Failing after 7m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 7m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 21s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 22s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 56s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 9m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 6m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 7m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 8m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E vue-3 (canary) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 9m Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 17s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 24s Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 22s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 16s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 1m Details

Comment thread packages/core/src/client.ts Outdated
@logaretm
logaretm merged commit fea30a2 into develop Oct 27, 2026
680 of 686 checks passed
@logaretm
logaretm deleted the awad/sample-errors-before-buffer branch October 27, 2026 14:49
logaretm added a commit that referenced this pull request Oct 27, 2026
…fer slot (#25753)

Backport of: #25751

## Differences to the original PR

- `packages/core/test/lib/client.test.ts`: the "does not set
lastEventId" test passes an explicit `event_id` and asserts
`lastEventId()` isn't it, instead of asserting `undefined`. v10's test
setup doesn't reset `lastEventId` between tests, so an earlier test's ID
leaks in.
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.

2 participants