mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-21 22:30:57 +00:00
recordCompletion() was reached only from done(), but init() can satisfy an acquisition entirely from the local store and return without ever calling done(). Those completions went uncounted, so acquire_completions read zero for a whole class of outcome. On a live clean-database sync it read 0 for 510 seconds while the node reached full, which was misread as the node completing nothing. Counted in init() rather than by calling done(), because done() drives the state machine: it stores the ledger, dispatches AcqDone, updates the fetch-rate average, and sets signaled_, which would disarm a later genuine done(). A counter must not change behaviour. A completionCounted_ latch, separate from signaled_, makes the count idempotent across the two independent exits so a completion is counted exactly once however it was reached. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
XRPL Source Guidelines
Each folder contains a single module following the newest style:
- One class per header
- As much implementation hidden as possible
- All major interfaces are abstract
- Every class is documented
- Each module focuses on solving one problem