Skip to content

Fix thread safety race condition on _running flag#19

Merged
enaboapps merged 1 commit intomasterfrom
fix/thread-safety-running-9
Feb 16, 2026
Merged

Fix thread safety race condition on _running flag#19
enaboapps merged 1 commit intomasterfrom
fix/thread-safety-running-9

Conversation

@enaboapps
Copy link
Owner

Summary

  • Protect _running flag with lock in _start_http_transport, _schedule_flush, disconnect, and disconnect_async
  • Prevents race condition between auto-flush timer thread and disconnect

Closes #9

Test plan

  • All 52 tests pass

- Protect _running flag access with lock in _start_http_transport, _schedule_flush
- Protect _running and _flush_timer in disconnect and disconnect_async
- Prevents race condition between auto-flush timer and disconnect

Closes #9

🤖 Auto-generated
@enaboapps enaboapps added this to the v1.1.0 milestone Feb 16, 2026
@enaboapps enaboapps merged commit a592db7 into master Feb 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Warning

Rate limit exceeded

@enaboapps has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/thread-safety-running-9

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@enaboapps enaboapps deleted the fix/thread-safety-running-9 branch February 16, 2026 10:18
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 thread safety race condition on _running flag

2 participants