← Back to Pull requests

Fix record loss when flushing bounded asynchronous queues #260

Closed
unknown closed this pull request without merging on Nov 13, 2026 20:43 UTC
View on GitHub
unknown unknown commented on Nov 08, 2026 18:57 UTC
Author

Flushing an asynchronous sink can silently discard records from producers waiting for queue space. This affects both bounded_fifo_queue and bounded_ordering_queue when used with block_on_overflow.

flush() uses the same queue wake-up operation as stop(). For bounded queues, that operation also cancels producers blocked by the overflow policy. Their consume() 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 as interrupt_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.

Diff: 202 lines (+151 / -51) across 2 files Reviewer: Lastique Review duration: 7306m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.2% (MEDIUM) · Higher = larger blast radius
36.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.3% · Safe to merge
14.3%
Repository