-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
op-node: Improve shutdown behavior #10936
Comments
op-node (and indexer / batcher) don't use Instead, there's The sub/main-commands can then utilize the context either with The idea here is that instead of attaching a system-signal based blocker to the context, you can also attach an artificial blocker, to fake an interrupt on a CLI app without having to run sub-processes; great for testing and potentially app composition (with mocktimism wrapping CLI apps). Note that this is also better than we had previously, because the interrupt receiver is registered on the main thread, almost as early as possible, before the CLI |
Ah nice, thank's for clearing that up, TIL! Will edit to remove the |
Will be closed in #8169 once Adrian updates to the latest |
We should still address the first two bullets independently, which are not fixed by #8169. E.g. we're still sequencing after p2p is shut down and we're missing shutdown logs. |
After going with @anacrolix over the code, we identified one minor improvement that would mostly solve this: in the shutdown path, if sequencing is active, stop sequencing before shutting down the p2p stack. |
I'm currently working on that. I have a potential PR from poking around the interrupt handling too. |
I found a bunch of bugs in the peer discovery while testing this. I'll have a PR for that. I modified op-node to stop sequencing before closing p2p. However the driver still tries to fetch L2 blocks from p2p after sequencing is stopped, I'm not sure this will work. Is it possible just to stop the driver completely instead? Or even the sequencer, then the driver, then the p2p? |
Wouldn't it still be an improvement to just stop sequencing before shutting down the p2p stack? A sequencer would this way just behave like a normal node during shutdown from that point on. Probably more reordering improvements can be done, as you suggested, e.g. to shut down p2p later. |
I don't quite follow. My testing shows p2p is still used until the driver is shutdown. So if it's okay to stop sequencing, then the driver, then p2p that should work its current form, but then do you really gain anything from shutting down sequencing first when you could just shut down the driver and get both for one? |
SIGINT
orSIGTERM
#8086The text was updated successfully, but these errors were encountered: