René's URL Explorer Experiment


Title: bug(v4): TracingSDK.flush() uses Promise.all, drops trace + log exports on shutdown when one provider rejects · Issue #3556 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: bug(v4): TracingSDK.flush() uses Promise.all, drops trace + log exports on shutdown when one provider rejects · Issue #3556 · triggerdotdev/trigger.dev

X Title: bug(v4): TracingSDK.flush() uses Promise.all, drops trace + log exports on shutdown when one provider rejects · Issue #3556 · triggerdotdev/trigger.dev

Description: Problem On self-hosted Trigger.dev v4.4.5, the user task's logger.info(...) calls and child-trigger spans are silently dropped from a run's dashboard trace when processKeepAliveEnabled is false (the default for self-host). Engine state e...

Open Graph Description: Problem On self-hosted Trigger.dev v4.4.5, the user task's logger.info(...) calls and child-trigger spans are silently dropped from a run's dashboard trace when processKeepAliveEnabled is false (th...

X Description: Problem On self-hosted Trigger.dev v4.4.5, the user task's logger.info(...) calls and child-trigger spans are silently dropped from a run's dashboard trace when processKeepAliveEnabled is f...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/3556

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug(v4): TracingSDK.flush() uses Promise.all, drops trace + log exports on shutdown when one provider rejects","articleBody":"## Problem\n\n\u003cimg width=\"1695\" height=\"655\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/c6513711-0fd5-418c-bd91-9b66db18d855\" />\n\n\nOn self-hosted Trigger.dev v4.4.5, the user task's `logger.info(...)` calls and child-trigger spans are silently dropped from a run's dashboard trace when `processKeepAliveEnabled` is `false` (the default for self-host). Engine state events (`QUEUED` / `PENDING_EXECUTING` / `EXECUTING` / `run:subscribe`) still appear because they're written server-side; only the user-emitted telemetry vanishes.\n\n## Environment\n\n- Trigger.dev v4.4.5 (Helm chart `oci://ghcr.io/triggerdotdev/charts/trigger:4.4.5`, image `ghcr.io/triggerdotdev/trigger.dev:v4.4.5`)\n- Self-hosted on Kubernetes (EKS), single-shard ClickHouse from the chart\n- Node 22.16.0 task runtime, `processKeepAliveEnabled: false`\n- `OTEL_EXPORTER_OTLP_ENDPOINT=http://trigger-webapp:3030/otel`\n\n## Root cause\n\n`TracingSDK.flush()` at [`packages/core/src/v3/otel/tracingSDK.ts#L371-L377`](https://github.com/triggerdotdev/trigger.dev/blob/v4.4.5/packages/core/src/v3/otel/tracingSDK.ts#L371-L377):\n\n```ts\npublic async flush() {\n  await Promise.all([\n    this._traceProvider.forceFlush(),\n    this._logProvider.forceFlush(),\n    this._meterProvider.forceFlush(),\n  ]);\n}\n```\n\n`Promise.all` semantics: the first rejection rejects the combined promise immediately, abandoning the other two providers' in-flight HTTP exports. The runner-side flush is invoked from the worker handler at [`packages/cli-v3/src/entryPoints/managed-run-worker.ts#L716-L731`](https://github.com/triggerdotdev/trigger.dev/blob/v4.4.5/packages/cli-v3/src/entryPoints/managed-run-worker.ts#L716-L731), which races a 5 s timeout — but a rejection short-circuits the race in milliseconds.\n\n`TracingSDK.shutdown()` at L379-L385 has the same bug.\n\n## Evidence\n\nRunner pod stdout at task completion (from CloudWatch, redacted run ID):\n\n```\n00:25:54.571  [execution] executing task run process    ← task fork spawned\n       ── 13.2 s of task code (with multiple logger.info calls + batchTrigger spans) ──\n00:26:07.791  [execution] completed run attempt\n00:26:07.792  [taskRunProcessProvider] Keep-alive disabled, cleaning up process immediately\n00:26:07.795  Flushed usage in 1.032 ms\n00:26:07.797  Flushed runMetadata successfully\n00:26:07.797  Failed to flush tracingSDK              ← here\n00:26:07.797  Flushed all in 4.039 ms\n00:26:07.878  [controller] Exiting process\n```\n\nTotal tracingSDK flush attempt: **4 ms** — well under the 5000 ms timeout. So one of `_traceProvider.forceFlush()` / `_logProvider.forceFlush()` / `_meterProvider.forceFlush()` rejected effectively synchronously, taking the entire flush down with it via \\`Promise.all\\`.\n\nWe verified separately that the backing infra was fully healthy throughout the window:\n- ClickHouse pod: 0 restarts, ~34% memory utilization, container Running, PVC bound.\n- Webapp's `/otel/v1/logs` endpoint was returning steady 200s.\n- Webapp's `ClickhouseEventRepository.flushBatch` was logging `Inserted batch into clickhouse` with non-zero `written_rows` every few seconds.\n\nSo the data simply never leaves the runner.\n\nMost likely rejecter: `_meterProvider.forceFlush()`. The metrics pipeline is the newest moving part in this path — wraps the OTLP metric exporter in a custom `BufferingMetricExporter` (tracingSDK.ts:311), introduced in #3061 with follow-up #3106. The trace and log paths are older and use stock OTel batch processors. But the `Promise.all` bug applies regardless of which provider rejects.\n\n## Suggested fix\n\nSwap `Promise.all` for `Promise.allSettled` in both `TracingSDK.flush()` and `TracingSDK.shutdown()`, and log per-provider rejections without bubbling them up:\n\n```ts\npublic async flush() {\n  const results = await Promise.allSettled([\n    this._traceProvider.forceFlush(),\n    this._logProvider.forceFlush(),\n    this._meterProvider.forceFlush(),\n  ]);\n  results.forEach((r, i) => {\n    if (r.status === 'rejected') {\n      const name = ['trace', 'log', 'meter'][i];\n      console.error(\\`Failed to flush \\${name} provider:\\`, r.reason);\n    }\n  });\n}\n```\n\nThat preserves visibility into which provider failed (currently lost—the worker just logs \"Failed to flush tracingSDK\" with no provider attribution) while letting the other two providers' flushes complete rather than being abandoned.\n\n## Impact\n\nAny task running on a worker with `processKeepAliveEnabled: false` is at risk of losing all user-emitted trace data on shutdown if any of the three providers rejects `forceFlush()`. For short tasks (under ~5–10 s), this manifests as a run with engine events only and no user spans/logs.\n\n## Reproduction (qualitative)\n\n1. Self-host v4.4.5 with the default Helm values.\n2. Deploy a task that calls \\`logger.info(...)\\` a few times and does \\`tasks.batchTriggerAndWait\\` on a small batch. Keep total task duration under 30 s.\n3. Trigger the task in prod.\n4. Open the run trace in the dashboard 1 min later.\n5. Observe: engine events present; \\`logger.info\\` lines and \\`batchTriggerAndWait\\` spans absent. Runner pod stdout (if accessible) shows \\`Failed to flush tracingSDK\\`.","author":{"url":"https://github.com/brentshulman-silkline","@type":"Person","name":"brentshulman-silkline"},"datePublished":"2026-05-12T01:17:02Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/3556"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:867d4952-f2bd-c9d7-97c4-1386ccd3ac3c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCD5A:1C77AB:30F997C:457B677:6AFAE9C9
html-safe-nonce5735fb04c49af57b98c55e8a4196ee2572044fe8725d36027cfb580aa4c03d32
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDVBOjFDNzdBQjozMEY5OTdDOjQ1N0I2Nzc6NkFGQUU5QzkiLCJ2aXNpdG9yX2lkIjoiNjExMzI3MTAwNzExODI4OTM1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac404e0179bec20bf6a709b10afdcbcf553b16e53a3cc58826ecde58eb182e38b7
hovercard-subject-tagissue:4425440661
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/trigger.dev/3556/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e2f3f604a3fdb5379666095efe4ab1128fbab4532796b3798924ecc01a70b135/triggerdotdev/trigger.dev/issues/3556
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e2f3f604a3fdb5379666095efe4ab1128fbab4532796b3798924ecc01a70b135/triggerdotdev/trigger.dev/issues/3556
og:image:altProblem On self-hosted Trigger.dev v4.4.5, the user task's logger.info(...) calls and child-trigger spans are silently dropped from a run's dashboard trace when processKeepAliveEnabled is false (th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebrentshulman-silkline
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release12fff95459b24b0f882a66698ee6a36a5934d247
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/issues/3556#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F3556
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2F3556
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/3556
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/3556
Reloadhttps://github.com/triggerdotdev/trigger.dev/issues/3556
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
https://github.com/triggerdotdev/trigger.dev
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/3556
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/3556
bug(v4): TracingSDK.flush() uses Promise.all, drops trace + log exports on shutdown when one provider rejectshttps://github.com/triggerdotdev/trigger.dev/issues/3556#top
https://github.com/brentshulman-silkline
brentshulman-silklinehttps://github.com/brentshulman-silkline
on May 12, 2026https://github.com/triggerdotdev/trigger.dev/issues/3556#issue-4425440661
https://private-user-images.githubusercontent.com/134343004/590789477-c6513711-0fd5-418c-bd91-9b66db18d855.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQ4MjkwNDUsIm5iZiI6MTc5NDgyODc0NSwicGF0aCI6Ii8xMzQzNDMwMDQvNTkwNzg5NDc3LWM2NTEzNzExLTBmZDUtNDE4Yy1iZDkxLTliNjZkYjE4ZDg1NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYxMTE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MTExNlQxMTMyMjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZWE1MDg2YzBiNGYyZDI4NjlkYjJlMzAzYWExZTU2MGJlZmYwZjY4YjExNDhlZDIxYjllZjcyYTk1ZDRhMDM2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.-5TJkHuQ8978IyFv5Aw4B7sf1Tya0TlGQ_qO0TP9InU
packages/core/src/v3/otel/tracingSDK.ts#L371-L377https://github.com/triggerdotdev/trigger.dev/blob/v4.4.5/packages/core/src/v3/otel/tracingSDK.ts#L371-L377
packages/cli-v3/src/entryPoints/managed-run-worker.ts#L716-L731https://github.com/triggerdotdev/trigger.dev/blob/v4.4.5/packages/cli-v3/src/entryPoints/managed-run-worker.ts#L716-L731
#3061https://github.com/triggerdotdev/trigger.dev/pull/3061
#3106https://github.com/triggerdotdev/trigger.dev/pull/3106
https://github.com/ericallam
ericallamhttps://github.com/ericallam
on May 12, 2026https://github.com/triggerdotdev/trigger.dev/issues/3556#issuecomment-4431105010
@claudehttps://github.com/claude
https://github.com/apps/claude
claudehttps://github.com/apps/claude
on May 12, 2026https://github.com/triggerdotdev/trigger.dev/issues/3556#issuecomment-4431119482
Claudehttps://anthropic.com/claude-code
@ericallamhttps://github.com/ericallam
View jobhttps://github.com/triggerdotdev/trigger.dev/actions/runs/25738511269
claude/issue-3556-20260512-1346https://github.com/triggerdotdev/trigger.dev/tree/claude/issue-3556-20260512-1346
Create PR ➔https://github.com/triggerdotdev/trigger.dev/compare/main...claude/issue-3556-20260512-1346?quick_pull=1&title=fix(core)%3A%20use%20Promise.allSettled%20in%20TracingSDK%20flush%2Fshutdown&body=%23%23%20Summary%0A%0A-%20Switch%20%60TracingSDK.flush()%60%20and%20%60shutdown()%60%20from%20%60Promise.all%60%20to%20%60Promise.allSettled%60%0A-%20Prevents%20one%20provider's%20rejection%20from%20abandoning%20other%20providers'%20in-flight%20exports%0A-%20Adds%20per-provider%20error%20logging%20for%20better%20debugging%0A%0AFixes%20%233556%0A%0A%23%23%20Test%20plan%0A%0A-%20%5B%20%5D%20Deploy%20to%20self-hosted%20environment%20with%20%60processKeepAliveEnabled%3A%20false%60%0A-%20%5B%20%5D%20Run%20task%20with%20%60logger.info()%60%20calls%20and%20verify%20they%20appear%20in%20trace%0A-%20%5B%20%5D%20Verify%20no%20%22Failed%20to%20flush%20tracingSDK%22%20errors%20in%20runner%20logs%0A%0A%F0%9F%A4%96%20Generated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)
Sign up for freehttps://github.com/signup?return_to=https://github.com/triggerdotdev/trigger.dev/issues/3556
Sign in to commenthttps://github.com/login?return_to=https://github.com/triggerdotdev/trigger.dev/issues/3556
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.