Skip to content

fix(tracing): clean up processors after tracing is disabled - #4502

Merged
seratch merged 3 commits into
openai:mainfrom
sylvesterkaczmarek:fix/disabled-tracing-cleanup
Aug 17, 2026
Merged

fix(tracing): clean up processors after tracing is disabled#4502
seratch merged 3 commits into
openai:mainfrom
sylvesterkaczmarek:fix/disabled-tracing-cleanup

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Summary

  • always run DefaultTraceProvider.shutdown() for registered processors
  • keep shutdown independent from whether new tracing is currently disabled
  • ensure processors created before or while tracing is disabled can release worker and client resources

DefaultTraceProvider.shutdown() previously returned early when the provider's disabled flag was set. Disabling tracing controls creation of new trace data, but registered processors can already own resources and still require shutdown. This is especially relevant for the default batch processor, which owns a worker thread and exporter client.

Test plan

  • added focused regression coverage in tests/test_disabled_trace_provider_shutdown.py
  • GitHub Actions

Issue number

N/A

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 17, 2026 21:35
@seratch seratch added this to the 0.21.x milestone Aug 17, 2026
@seratch
seratch merged commit c5f6a71 into openai:main Aug 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants