Stop reentrant transport logging feedback [#68] #76
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 356 lines diff across 4 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.352
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #76"
general
weight: 0.35
AM-L
Problem and behavior
A transport callback that logs on every write can perpetuate an unlimited feedback loop: one external record produces another record on each subsequent
drainOnce(). Deferring reentrant records to the next drain does not stop amplification.Register consumer-thread logging rings with
addConsumerRing(). All rings are snapshotted before dispatch; records written to consumer-owned rings during dispatch are acknowledged without transport delivery and counted inhealthSnapshot().reentrantRecords. NesteddrainOnce()calls return zero. Independent producer rings retain concurrent records and immediate saturation refusal.The consumer ring must have the consumer thread as its sole producer. Callback logging must use these rings. Suppression applies to all transports, including healthy ones; consumer-thread logs written outside dispatch remain deliverable. The migration guide documents this contract. Governed records and producer admission are unchanged.
Also expose
removeTransport()for ordinary disconnection, release self-handle lookup cells on removal, and retain failure accounting only for failure paths.Validation
cmake --build --preset ninja-macos-clang --parallel, passed.libmddlog.aandmddlog_specslinked successfully.ctest --preset ninja-macos-clang, 108/108 tests passed.--dry-run --Werror. The equivalent direct check was used because macOS system Bash lacks the script'smapfilebuiltin.Addresses #68. ADR-003 acceptance remains a separate review decision; #69 is not implemented by this PR.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Transport health information now reports records written reentrantly during dispatch.
Consumer-thread logging during dispatch is suppressed; records written outside dispatch remain deliverable.
Nested drain attempts on the consumer thread return zero.
Transports can be removed without counting the removal as a failure.
Documentation
* Added guidance on ring ownership, registration, reentrant logging, and transport removal, including ring lifetime and producer/consumer requirements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->