Fix asynchronous sink flush hangs and incomplete flushes #259
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 229 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.325
Real PR Conversation Timeline
1 comments
"Review active on #259"
general
weight: 0.35
Lastique
asynchronous_sink::flush()can leave logging blocked or return before queued records have been processed:flush(), the flush-requested flag remains set. Laterconsume()calls block indefinitely, andtry_consume()rejects records.start_thread=false),flush()can wait indefinitely if the feeding call exits or throws while a flush request is pending. Producers also remain blocked.try_dequeue_ready()can return false while records remain inside the ordering window. If a flush request arrives after the feeder chooses that ready-only check, the original code can leave the dequeue loop and flush the backend without first draining those records.Retry with
try_dequeue()when a flush arrives during a failed ready-record check. Keep later requests pending until a feeding operation can drain them. Let waiting flush callers take over when feeding ends, preserve pending requests across feeder changes, and clear abandoned requests so exceptions during caller-driven flushing do not leave producers blocked.Four separate regression executables cover feeder exceptions, incomplete ordering-queue flushes, logging after a failed flush, and feeder replacement. Against the original code, controlled queue and backend pauses demonstrate a flush exceeding its deadline, an ordering queue delivering 0 of 1 records, and producers remaining blocked after a drain exception. These cases pass with the fix.
The feeder-replacement case guards against a regression the cleanup could introduce. Each executable has a ten-second process watchdog so a deadlock fails its own test without hanging the remaining cases. All four tests and the existing #255 regression test pass on macOS with C++11.