fix: handle condition waiting better in thread_task_executor#1690
Conversation
The pattern used for the condition waiting was not robust enough and was susceptible to a race condition. This prevents that class of race condition by persisting the status and checking it when the signal is received, rather then relying on the assumption the notification always happens after all the relevant waiters are ready to receive it. JIRA: CQ-2677 risk: low
Move the call_finalizer_middleware before the lock acquisition. In case it fails, it no longer does so holding (and not releasing) the lock. There is nothing in the call_finalizer_middleware itself that would need the lock to be held. JIRA: CQ-2677 risk: low
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change adds explicit completion-state tracking to ChangesTask result lifecycle
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1690 +/- ##
=======================================
Coverage 78.02% 78.02%
=======================================
Files 271 271
Lines 18637 18639 +2
=======================================
+ Hits 14542 14544 +2
Misses 4095 4095 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The pattern used for the condition waiting was not robust enough and was susceptible to a race condition.
This prevents that class of race condition by persisting the status and checking it when the signal is received, rather than relying on the assumption the notification always happens after all the relevant waiters are ready to receive it.
Also, do the finalizer retrieval outside of the critical section: if it fails, it no longer holds the lock forever.
JIRA: CQ-2677
risk: low
Summary by CodeRabbit