fix: [AI-190] prevent tracing exporter timeout from leaking timers#191
Merged
anandgupta42 merged 1 commit intomainfrom Mar 16, 2026
Merged
fix: [AI-190] prevent tracing exporter timeout from leaking timers#191anandgupta42 merged 1 commit intomainfrom
anandgupta42 merged 1 commit intomainfrom
Conversation
- Add `clearTimeout` in `.finally()` to `withTimeout` so the event loop exits immediately after `endTrace()` instead of hanging for 5 seconds - Log a `console.warn` when an exporter times out (uses the previously unused `name` parameter for diagnostics) - Align `HttpExporter` internal `AbortSignal.timeout` from 10s to 5s to match the per-exporter wrapper timeout - Clean up safety-net timer in adversarial test to prevent open handles Closes #190 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
anandgupta42
added a commit
that referenced
this pull request
Mar 17, 2026
) - Add `clearTimeout` in `.finally()` to `withTimeout` so the event loop exits immediately after `endTrace()` instead of hanging for 5 seconds - Log a `console.warn` when an exporter times out (uses the previously unused `name` parameter for diagnostics) - Align `HttpExporter` internal `AbortSignal.timeout` from 10s to 5s to match the per-exporter wrapper timeout - Clean up safety-net timer in adversarial test to prevent open handles Closes #190 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the
withTimeouthelper inTracer.endTrace()to properly clean upsetTimeouttimers, preventing the Node.js/Bun event loop from hanging for 5 seconds after every trace export. Also adds timeout logging for observability and aligns theHttpExporterinternal timeout with the per-exporter wrapper.Type of change
Issue for this PR
Closes #190
How did you verify your code works?
bun test test/altimate/tracing-adversarial.test.ts)[tracing] Exporter "hanging" timed out after 5000msChecklist
Changes:
clearTimeoutin.finally()towithTimeoutso the event loop exits immediately afterendTrace()instead of hanging for 5 secondsconsole.warnwhen an exporter times out (uses the previously unusednameparameter for diagnostics)HttpExporterinternalAbortSignal.timeoutfrom 10s to 5s to match the per-exporter wrapper timeout🤖 Generated with Claude Code