-
Notifications
You must be signed in to change notification settings - Fork 70
fix(eth): reorder ethereum shutdown sequence #2277
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
base: dev-upgrade
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -580,16 +580,37 @@ func (e *Ethereum) Start() error { | |||||||||||
| // Stop implements node.Lifecycle, terminating all internal goroutines used by the | ||||||||||||
| // Ethereum protocol. | ||||||||||||
| func (e *Ethereum) Stop() error { | ||||||||||||
| log.Info("Stopping Ethereum bloomIndexer start") | ||||||||||||
| e.bloomIndexer.Close() | ||||||||||||
| log.Info("Ethereum bloomIndexer stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum blockchain start") | ||||||||||||
| e.blockchain.Stop() | ||||||||||||
| log.Info("Ethereum blockchain stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum protocolManager start") | ||||||||||||
| e.protocolManager.Stop() | ||||||||||||
| log.Info("Ethereum protocolManager stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum txPool start") | ||||||||||||
| e.txPool.Close() | ||||||||||||
| log.Info("Ethereum txPool stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum shutdownChan start") | ||||||||||||
| close(e.shutdownChan) | ||||||||||||
| log.Info("Ethereum shutdownChan stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum miner start") | ||||||||||||
| e.miner.Stop() | ||||||||||||
| log.Info("Ethereum miner stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum eventMux start") | ||||||||||||
| e.eventMux.Stop() | ||||||||||||
| log.Info("Ethereum eventMux stopped") | ||||||||||||
|
|
||||||||||||
| log.Info("Stopping Ethereum chainDb start") | ||||||||||||
| e.chainDb.Close() | ||||||||||||
|
Comment on lines
+599
to
612
|
||||||||||||
| e.chainDb.Close() | |
| if err := e.chainDb.Close(); err != nil { | |
| log.Error("Failed to stop Ethereum chainDb", "err", err) | |
| return err | |
| } |
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.
e.bloomIndexer.Close()returns an error, but it’s currently ignored while logs unconditionally report it as “stopped”. SinceEthereum.Stop()has anerrorreturn, consider capturing/propagating the close error (or at least logging it) so shutdown failures aren’t silently missed.