Title: Node: process never exits since 10.72 — beforeExit session send + client-report flush feed each other (skipOpenTelemetrySetup: true) · Issue #24262 · getsentry/sentry-javascript · GitHub
Open Graph Title: Node: process never exits since 10.72 — beforeExit session send + client-report flush feed each other (skipOpenTelemetrySetup: true) · Issue #24262 · getsentry/sentry-javascript
X Title: Node: process never exits since 10.72 — beforeExit session send + client-report flush feed each other (skipOpenTelemetrySetup: true) · Issue #24262 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/24262
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Node: process never exits since 10.72 — beforeExit session send + client-report flush feed each other (skipOpenTelemetrySetup: true)","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/node\n\n### SDK Version\n\n10.73.0 (also 10.72.0; 10.54.0 is fine)\n\n### Framework Version\n\nNode 22.22.2\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n```js\n// repro.mjs — run with a DSN pointing at any HTTP server that answers 200, e.g. a stub on localhost\nimport * as Sentry from \"@sentry/node\"\nSentry.init({\n dsn: process.env.SENTRY_DSN,\n release: \"1.0.0\", // any release, so the process session is sendable\n skipOpenTelemetrySetup: true, // we run our own OTel pipeline elsewhere\n tracesSampleRate: undefined, // tracing off\n})\nconsole.log(\"done; letting the process exit naturally\")\n```\n\nStub receiver used for the counts below:\n\n```js\nimport http from \"node:http\"\nlet n = 0\nhttp.createServer((req, res) => { let b = \"\"; req.on(\"data\", c => b += c); req.on(\"end\", () => {\n n++; console.log(n, req.url, [...b.matchAll(/\"type\":\"([a-z_]+)\"/g)].map(m => m[1]).join(\",\"), b.slice(-160)); res.end(\"{}\") }) }).listen(9999)\n```\n\n### Steps to Reproduce\n\n1. `node stub.mjs`\n2. `SENTRY_DSN=http://k@localhost:9999/1 node repro.mjs`\n\n### Expected Result\n\nThe process sends the session (and at most one client report) and exits.\n\n### Actual Result\n\nThe process never exits. The stub receives one `session` envelope and then an endless stream of `client_report` envelopes, each containing:\n\n```json\n{\"discarded_events\":[{\"reason\":\"no_parent_span\",\"category\":\"span\",\"quantity\":1}]}\n```\n\nCPU sits at 60–100% against a local stub; against a real DSN the loop is network-bound but the process is still immortal. We hit this in a Cloud Run job running database migrations, which hung until its 600 s task timeout on every deploy after upgrading from 10.54.\n\nWhat appears to happen:\n\n1. #23731 (10.72) makes `processSessionIntegration` end the session on `beforeExit` when its status is `ok`, so a healthy process now sends a `session` envelope at exit (previously the condition was inverted and healthy processes sent nothing).\n2. That transport request is instrumented by the http integration. With no OTel setup and tracing off, its span is dropped and `recordDroppedEvent(\"no_parent_span\", \"span\")` records an outcome.\n3. The client-report `beforeExit` listener flushes the new outcome → another instrumented request → another `no_parent_span` outcome → `beforeExit` again → …\n\nConfirmed by elimination:\n\n| init options | result |\n|---|---|\n| `{ dsn, release }` | 1 session, exits |\n| `{ dsn, release, skipOpenTelemetrySetup: true }` | 1 session + infinite client reports, never exits |\n| `{ dsn, release, skipOpenTelemetrySetup: true, sendClientReports: false }` | 1 session, exits |\n| same as row 2 on 10.54.0 | nothing sent, exits |\n\n`await Sentry.close()` before exiting also avoids it, but the default behaviour of a process that simply finishes should not be to hang.\n\n### Additional Context\n\nSuggested fixes: don't record a `no_parent_span` outcome for the SDK's own transport requests, and/or don't re-arm the client-report flush from within a `beforeExit` flush (e.g. only flush outcomes that existed before the current `beforeExit` tick).\n\n### Priority\n\nMedium\n","author":{"url":"https://github.com/martingui8","@type":"Person","name":"martingui8"},"datePublished":"2026-09-09T16:56:07Z","url":"https://github.com/getsentry/sentry-javascript/issues/24262"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1cd4d44c-a5f7-2bdc-ade1-9a32e96fea76 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CB24:2E8AC8:35B829:4B3E9B:6B047846 |
| html-safe-nonce | 20fb4bae4eed2cae926866f07dc3176fa37d5083050abf83d4feab59a3c9d93f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjI0OjJFOEFDODozNUI4Mjk6NEIzRTlCOjZCMDQ3ODQ2IiwidmlzaXRvcl9pZCI6IjYxNDM2MTQ0Mzk5NjQwNDc0MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cdd4030ccfb13d87f573536eb32ed5e8e172780f00eb2dc6a78bfe3bbe6388ff |
| hovercard-subject-tag | issue:5402358685 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/24262/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6c950195bee68f0c484efa3657efe968e8a11a28692b2d132ac8aa3c1a2c71fc/getsentry/sentry-javascript/issues/24262 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6c950195bee68f0c484efa3657efe968e8a11a28692b2d132ac8aa3c1a2c71fc/getsentry/sentry-javascript/issues/24262 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | martingui8 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width