Skip to content

Fix batch exporter shutdown race condition#46

Open
Nancy-Chauhan wants to merge 1 commit into
mainfrom
fix/batch-shutdown
Open

Fix batch exporter shutdown race condition#46
Nancy-Chauhan wants to merge 1 commit into
mainfrom
fix/batch-shutdown

Conversation

@Nancy-Chauhan
Copy link
Copy Markdown
Owner

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 #37

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 #37
Copy link
Copy Markdown
Owner Author

@Nancy-Chauhan Nancy-Chauhan 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.

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.

Batch exporter drops last batch on shutdown

1 participant