Repository navigation
fix(node): stop a live stream as soon as its pool turns Closing - #3006
Merged
Merged
Conversation
The mid-stream pool re-check holds the admission rule for the whole stream: a pool that is not Open stops the stream. A Closing pool takes no top-up, so its owner is winding it down; rotating a pool means draining it, not closing it under live streams. Stopping at Closing leaves the node the whole dispute window to redeem what it holds, so the re-check no longer reads the dispute deadline or the redeem margin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 26, 2026
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 5 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The mid-stream pool re-check (#2812) kept serving a
Closingpool until its dispute deadline came inside the redeem margin. With the default 48h window, a stream that started beforeinitiateClosecould keep running for almost two days. Admission already refuses anyClosingpool, so a client that reconnected was refused anyway.Change
pool_recheck_stopholds the admission rule for the whole stream: a pool that is notOpen(or that the view no longer holds) stops the stream asServeStop::PoolClosed, withPoolExhaustedon the wire. It no longer reads the dispute deadline orinside_expiry_margin.Closingleaves the node the whole dispute window to redeem what it holds; the periodic sweep (at most 6h) runs many times inside it.PoolClosed/ metric docstrings now describe the rule.decdn_serve_stream_midstream_pool_closed_totalnow also flags owners who close under live streams.Tests
Closingpool stops at its deadline and two days before it; the margin-boundary test is gone.u64::MAX) and still stop in-band. The "Closing a day out serves toStreamEnd" test is removed: that behaviour is gone.cargo nextest run -p decdn-node: 1623 passed. Clippy--all-targets --all-features -D warnings, fmt andcargo docwith warnings denied are clean.Makes #3004 / #2813 (a redeemer wake at the close deadline minus the margin) unnecessary.
🤖 Generated with Claude Code