-
Notifications
You must be signed in to change notification settings - Fork 82
feat(l2): make monitor quit #3622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR switches the L2 monitor shutdown handling from using TaskTracker
to JoinSet
so that quitting the monitor (Shift + Q
) ends the process cleanly.
- Break out of the sequencer loop when the first L2 task completes successfully.
- Replace top‐level
TaskTracker
in the CLI command with aJoinSet
and add a select branch to handle monitor quit. - Persist node config and cancel tasks when the monitor is closed.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
crates/l2/sequencer/mod.rs | Changed the Ok(Ok(_)) match arm to break out of the join loop. |
cmd/ethrex/l2/command.rs | Imported JoinSet , initialized it, replaced tracker.spawn with join_set.spawn , and added a new select branch on join_next() . |
Comments suppressed due to low confidence (1)
cmd/ethrex/l2/command.rs:231
- There are no tests verifying that pressing Shift+Q triggers this branch, cancels tasks, and persists the node config. Consider adding an integration test for the monitor shutdown flow.
_ = join_set.join_next() => {
@@ -227,6 +228,16 @@ impl Command { | |||
tokio::time::sleep(Duration::from_secs(1)).await; | |||
info!("Server shutting down!"); | |||
} | |||
_ = join_set.join_next() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When handling the first completed child task via join_set.join_next()
, you don’t abort or await the remaining tasks. Explicitly abort pending tasks or await their completion to avoid background leaks.
Copilot uses AI. Check for mistakes.
Lines of code reportTotal lines added: Detailed view
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one small comment
Motivation
When the monitor is quitted with
Shift + Q
it closes the monitor but does not end the processDescription
Changed the L2 task initialization to use
JoinSet
instead of aTaskTracker
, so it can be joined and end the process if it ended.How to test
--monitor
to theinit-l2-no-metrics
target incrates/l2/Makefile
.make restart
incrates/l2
).make init-prover
incrates/l2
.make test
incrates/l2
.Shift + Q
to close the monitorCloses #3512