Fix record loss when flushing bounded asynchronous queues #260
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 202 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.318
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #260"
general
weight: 0.35
Lastique
Flushing an asynchronous sink can silently discard records from producers waiting for queue space. This affects both
bounded_fifo_queueandbounded_ordering_queuewhen used withblock_on_overflow.flush()uses the same queue wake-up operation asstop(). For bounded queues, that operation also cancels producers blocked by the overflow policy. Theirconsume()calls then return without enqueueing their records.Separate waking the consumer from cancelling blocked producers. Flushing the built-in bounded queues now wakes only the consumer, allowing blocked producers to enqueue their records as space becomes available.
stop()retains its existing cancellation behavior.The bounded policies expose a separate
interrupt_dequeue_for_flush()hook. Other custom queue strategies continue through their existing no-argument interruption call unless they provide the new hook. Using a distinct name preserves existing overloads such asinterrupt_dequeue(bool wake = true)without assigning a new meaning to their arguments.Separate FIFO and ordering regression executables each pause the backend on a first record, fill a one-slot queue with a second record, and block a third producer for queue space. They then start a flush and release the backend. Before the fix, all three producer calls return but only two records reach the backend. With the fix, all three records are delivered.
A third executable checks that a legacy custom queue with a defaulted boolean interruption argument keeps its original wake behavior. All three tests have ten-second process watchdogs and pass on macOS with C++11.