Skip to content

Fix batch exporter shutdown race condition#267

Closed
seldo wants to merge 1 commit into
mainfrom
fix/batch-shutdown
Closed

Fix batch exporter shutdown race condition#267
seldo wants to merge 1 commit into
mainfrom
fix/batch-shutdown

Conversation

@seldo
Copy link
Copy Markdown
Owner

@seldo seldo commented Mar 4, 2026

Summary

  • Adds a more robust atexit handler for BatchProcessor
  • Ensures the flush thread completes before interpreter exit
  • Fixes the race condition where the last batch is dropped

Closes #258

Testing

  • Added regression test for shutdown flush
  • All existing tests pass
  • Manual testing with atexit scenario

Adds a more robust atexit handler that waits for the flush thread
to complete. This fixes the race condition where the daemon thread
is killed before the final flush.

Closes #258
Copy link
Copy Markdown
Owner Author

@seldo seldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The atexit handler approach is solid. Verified that the flush completes before exit. Approved by Bob.

@seldo seldo closed this Mar 4, 2026
@seldo seldo deleted the fix/batch-shutdown branch March 4, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant