Repository navigation
Description
Problem
A bundle pull halts its sibling entries when one entry ends the pull, and waits for their drain (#2509). Three gaps remain at the end of such a pull.
1. A pool replacement can go unreported
replaced_pool reads only the pull's stopped error. Two cases lose the replacement:
- A sibling replaces the pool during the drain. Entry A gives up and halts the pull. Sibling B is in a funding recovery step, which runs to its outcome, and opens a new pool.
run_groupsdrops B'sPoolReplaced, because only an untracked escrow is folded in.BundleOutcome.replacedisNone, soobserver.pool_replaceddoes not run and the CLI skips its "reclaim it with: decdn pool reclaim" note. - A late escrow folds over a
PoolReplaced. The escrow is the root andPoolReplacedsurvives only as text, soreplaced_poolmisses it. This was noted (low) in fix(client): a bundle pull drops sibling entries mid-drain, losing a late escrow and allowing exit 75 #2509.
No funds are lost: open_replacement records the new pool before it returns. But the user is not told that the closed pool may hold a balance to reclaim.
2. Entries the pull did not run are not in the summary
A halted entry's destinations are EntryOutcome::NotRun. bundle_report does not count them, so fetched + linked + skipped + failed is less than the entry count, and neither the summary nor --json says how many entries the pull did not run.
3. A dropped entry's pending escrow reaches only the CLI
GROUP_DRAIN (40 s) is shorter than RECEIPT_TIMEOUT (3 min). An entry in a slow recovery step can still be dropped while its receipt read is pending. The UnconfirmedEscrows handle keeps the tx, and decdn get names it (name_held_escrows). But pull_end folds only untracked() into a Stopped end, so a library caller of BundlePuller gets the bare stop unless it reads BundlePuller::unconfirmed_escrows itself.
Fix direction
- Take
replacedfrom the recovery gate (GateState.replaced), read beforestart_next_passclears it, not from the error. Keep the second-pass trigger on aPoolReplacedstop only, so a give-up never starts a second pass. - Add a
not_runcount toBundleReport, and print it in the summary. - Fold
escrows.pending()into a non-interruptedStoppedend inpull_end, as it foldsuntracked().
Checks
- A pull that gives up while a sibling's step replaces the pool reports the replaced pool, and the CLI prints the reclaim note. No second pass runs.
- A late escrow that folds over a
PoolReplacedstill reports the replaced pool. - A halted pull's summary counts the entries it did not run.
- A
BundlePullerpull that drops an entry with a pendingtopUpendsStopped, naming that tx.
Found in the #2509 review (silent-failure and code-review passes).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity