Skip to content

fix(core): Avoid blocking the process for weightBasedFlushing#19174

Merged
JPeer264 merged 1 commit intodevelopfrom
jp/unref-safely
Feb 5, 2026
Merged

fix(core): Avoid blocking the process for weightBasedFlushing#19174
JPeer264 merged 1 commit intodevelopfrom
jp/unref-safely

Conversation

@JPeer264
Copy link
Member

@JPeer264 JPeer264 commented Feb 5, 2026

closes #19171
closes JS-1641

This was is something that got missed by Copilot on #19062

@JPeer264 JPeer264 self-assigned this Feb 5, 2026
@linear
Copy link

linear bot commented Feb 5, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Codecov Results 📊


Generated by Codecov Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.43 kB -0.02% -4 B 🔽
@sentry/browser - with treeshaking flags 23.9 kB +0.02% +4 B 🔺
@sentry/browser (incl. Tracing) 42.27 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Profiling) 46.92 kB -0.02% -6 B 🔽
@sentry/browser (incl. Tracing, Replay) 80.91 kB +0.01% +8 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.52 kB +0.04% +22 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 85.61 kB -0.01% -4 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 97.79 kB +0.01% +1 B 🔺
@sentry/browser (incl. Feedback) 42.15 kB -0.01% -2 B 🔽
@sentry/browser (incl. sendFeedback) 30.11 kB -0.02% -6 B 🔽
@sentry/browser (incl. FeedbackAsync) 35.13 kB +0.02% +4 B 🔺
@sentry/browser (incl. Metrics) 26.54 kB +0.01% +2 B 🔺
@sentry/browser (incl. Logs) 26.69 kB -0.03% -8 B 🔽
@sentry/browser (incl. Metrics & Logs) 27.36 kB +0.03% +8 B 🔺
@sentry/react 27.14 kB -0.05% -13 B 🔽
@sentry/react (incl. Tracing) 44.52 kB -0.01% -3 B 🔽
@sentry/vue 29.87 kB +0.03% +8 B 🔺
@sentry/vue (incl. Tracing) 44.09 kB +0.02% +8 B 🔺
@sentry/svelte 25.44 kB -0.04% -8 B 🔽
CDN Bundle 27.97 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing) 43.04 kB -0.01% -1 B 🔽
CDN Bundle (incl. Logs, Metrics) 28.82 kB +0.02% +3 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 43.87 kB +0.01% +3 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 67.75 kB -0.01% -5 B 🔽
CDN Bundle (incl. Tracing, Replay) 79.8 kB +0.02% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 80.67 kB -0.01% -5 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 85.23 kB +0.01% +1 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.13 kB -0.02% -13 B 🔽
CDN Bundle - uncompressed 81.83 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 127.54 kB +0.02% +14 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 84.66 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.37 kB +0.02% +14 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.04 kB +0.01% +14 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.14 kB +0.01% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 246.96 kB +0.01% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 256.94 kB +0.01% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 259.75 kB +0.01% +14 B 🔺
@sentry/nextjs (client) 46.87 kB -0.01% -2 B 🔽
@sentry/sveltekit (client) 42.66 kB +0.01% +3 B 🔺
@sentry/node-core 52.18 kB -0.01% -3 B 🔽
@sentry/node 166.3 kB +0.01% +5 B 🔺
@sentry/node - without tracing 93.97 kB -0.01% -1 B 🔽
@sentry/aws-serverless 109.48 kB +0.01% +2 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 11,874 - 10,979 +8%
GET With Sentry 2,099 18% 1,810 +16%
GET With Sentry (error only) 7,761 65% 7,340 +6%
POST Baseline 1,322 - 1,076 +23%
POST With Sentry 665 50% 539 +23%
POST With Sentry (error only) 1,156 87% 957 +21%
MYSQL Baseline 3,601 - 3,800 -5%
MYSQL With Sentry 534 15% 453 +18%
MYSQL With Sentry (error only) 3,044 85% 3,032 +0%

View base workflow run

@JPeer264 JPeer264 merged commit b7f8cfe into develop Feb 5, 2026
214 checks passed
@JPeer264 JPeer264 deleted the jp/unref-safely branch February 5, 2026 09:36
BYK added a commit to getsentry/cli that referenced this pull request Feb 16, 2026
…es (#249)

## Summary

Upgrade `@sentry/bun` and `@sentry/node` from 10.38.0 → 10.39.0 and
remove all custom patches/workarounds that are now fixed upstream.

## Changes

- **Removed `patches/@sentry%2Fcore@10.38.0.patch`** (92 lines) — Added
`.unref()` to timers in `setupWeightBasedFlushing`,
`_isClientDoneProcessing`, and `makePromiseBuffer` to prevent the CLI
from hanging on exit. Fixed upstream by
[#19062](getsentry/sentry-javascript#19062) and
[#19174](getsentry/sentry-javascript#19174).
- **Removed runtime context workaround in `src/lib/telemetry.ts`** (14
lines) — Manually overrode `options.runtime` after `Sentry.init()` to
report Bun instead of Node.js. Fixed upstream — `NodeClient` now uses
`options.runtime || { name: 'node', ... }` and `@sentry/bun` passes `{
name: 'bun', version: Bun.version }`. Tracked as
[#19269](getsentry/sentry-javascript#19269).
- **Updated `package.json`** — Bumped both SDK packages to `10.39.0` and
removed `@sentry/core` from `patchedDependencies`.

## Verification

- Verified all three upstream fixes by reading the 10.39.0 source code
and linked PRs
- `bun install`, typecheck, lint, and tests all pass cleanly
- No new test failures introduced (pre-existing ~95 failures on `main`
are unrelated)
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.

Metrics flush timer should use .unref() to not block process exit

3 participants