fix(cli): handle Ctrl+C during bench catchup#297
Merged
Conversation
Contributor
Greptile SummaryThis PR adds graceful Ctrl+C handling to the two phases of the bench catchup path that previously had no cancellation support: the pre-catchup delay ( Key changes:
Confidence Score: 5/5
Sequence DiagramsequenceDiagram
participant User
participant run() as run()
participant wait_or_cancel
participant timeout_or_cancel
participant catchup_stream
run()->>wait_or_cancel: wait_or_cancel(catchup_delay, ctrl_c())
alt ctrl_c fires first
User->>wait_or_cancel: Ctrl+C
wait_or_cancel-->>run(): DelayOutcome::Cancelled
run()-->>User: return Ok(())
else delay elapses
wait_or_cancel-->>run(): DelayOutcome::Elapsed
end
loop catchup read loop
run()->>timeout_or_cancel: timeout_or_cancel(deadline, catchup_stream.next(), ctrl_c())
alt ctrl_c fires first
User->>timeout_or_cancel: Ctrl+C
timeout_or_cancel-->>run(): CatchupOutcome::Cancelled
run()-->>User: return Ok(())
else deadline exceeded
timeout_or_cancel-->>run(): CatchupOutcome::TimedOut
run()-->>User: return Err(BenchVerification)
else item received
catchup_stream-->>timeout_or_cancel: Some(Ok(sample))
timeout_or_cancel-->>run(): CatchupOutcome::Item(Some(Ok(sample)))
else stream ended
catchup_stream-->>timeout_or_cancel: None
timeout_or_cancel-->>run(): CatchupOutcome::Item(None)
run()-->>run(): break
end
end
Last reviewed commit: 71832d8 |
Merged
shikhar
pushed a commit
that referenced
this pull request
Mar 6, 2026
## 🤖 New release * `s2-lite`: 0.29.19 -> 0.29.20 (✓ API compatible changes) * `s2-sdk`: 0.24.6 -> 0.24.7 (✓ API compatible changes) * `s2-cli`: 0.29.19 -> 0.29.20 <details><summary><i><b>Changelog</b></i></summary><p> ## `s2-lite` <blockquote> ## [0.29.20] - 2026-03-06 ### Features - Default append pipelining with durability-gated acks ([#289](#289)) ### Bug Fixes - Keep follow sessions alive across dormancy ([#301](#301)) ### Miscellaneous Tasks - Dep updates ([#299](#299)) <!-- generated by git-cliff --> </blockquote> ## `s2-sdk` <blockquote> ## [0.24.7] - 2026-03-06 ### Miscellaneous Tasks - Dep updates ([#299](#299)) <!-- generated by git-cliff --> </blockquote> ## `s2-cli` <blockquote> ## [0.29.20] - 2026-03-06 ### Bug Fixes - Handle Ctrl+C during bench catchup ([#297](#297)) <!-- generated by git-cliff --> </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: s2-release-plz[bot] <262023388+s2-release-plz[bot]@users.noreply.github.com>
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.
Summary
s2 benchrespond to Ctrl+C instead of blocking intokio::time::sleepTesting