Skip to content

fix: isFlushingEvents flag can get stuck true if publishEvents throws#193

Open
jonathannorris wants to merge 2 commits intomainfrom
fix/isflushingevents-stuck-true
Open

fix: isFlushingEvents flag can get stuck true if publishEvents throws#193
jonathannorris wants to merge 2 commits intomainfrom
fix/isflushingevents-stuck-true

Conversation

@jonathannorris
Copy link
Copy Markdown
Member

Wraps the publish loop in a try/finally so isFlushingEvents is always reset to false, even if publishEvents() throws InterruptedException.

Without this, any exception escaping the loop leaves the flag permanently true and all subsequent flushEvents() calls return early, causing events to accumulate and never be sent.

Fixes #192

Copilot AI review requested due to automatic review settings May 4, 2026 19:45
@jonathannorris jonathannorris requested a review from a team as a code owner May 4, 2026 19:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Ensures the local event flushing logic can’t get permanently “locked” by resetting isFlushingEvents via try/finally even when publishEvents() throws, preventing future flushEvents() calls from returning early and leaving events unsent.

Changes:

  • Wraps the event publish loop in flushEvents() in a try/finally.
  • Guarantees isFlushingEvents is always reset to false after a flush attempt, even on exception.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

fix: isFlushingEvents flag can get stuck true if publish loop throws

3 participants