Skip to content

fix: #3354 interrupt tracing retry backoff on shutdown#3355

Open
Aphroq wants to merge 1 commit into
openai:mainfrom
Aphroq:fix/tracing-shutdown-deadline
Open

fix: #3354 interrupt tracing retry backoff on shutdown#3355
Aphroq wants to merge 1 commit into
openai:mainfrom
Aphroq:fix/tracing-shutdown-deadline

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 11, 2026

Summary

Follow-up to #3343: finite-timeout tracing shutdown now requests the OpenAI tracing exporter to stop retry backoff that was already in progress before shutdown started.

This lets BatchTraceProcessor.shutdown(timeout=...) wake a 5xx retry sleep and finish cleanup promptly instead of waiting for the timeout and returning with the worker still alive. shutdown(timeout=None) still preserves the existing full retry behavior.

The atexit subprocess regression now runs as a serial test and asserts the child process's measured shutdown duration, avoiding xdist wall-clock contention while still checking that the original exit code is preserved.

Test plan

  • uv run pytest tests/test_trace_processor.py::test_batch_trace_processor_shutdown_interrupts_exporter_retry_backoff tests/test_trace_processor.py::test_batch_trace_processor_shutdown_without_timeout_preserves_export_retries tests/test_trace_processor.py::test_tracing_atexit_cleanup_timeout_preserves_process_exit_code_on_504 -q
  • uv run pytest tests/test_trace_processor.py -q
  • uv run pytest -n auto --dist loadfile -m "not serial" tests/test_trace_processor.py -q
  • uv run pytest -m serial tests/test_trace_processor.py::test_tracing_atexit_cleanup_timeout_preserves_process_exit_code_on_504 -q
  • bash .agents/skills/code-change-verification/scripts/run.sh

Issue number

Closes #3354

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@github-actions github-actions Bot added bug Something isn't working feature:tracing labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing shutdown cannot interrupt exporter retry backoff

1 participant