mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
eth: close engine before handler for graceful shutdown (#1189)
This commit is contained in:
parent
ffe810e55a
commit
f6969dbc46
1 changed files with 6 additions and 1 deletions
|
|
@ -822,6 +822,12 @@ func (s *Ethereum) Stop() error {
|
|||
// Stop all the peer-related stuff first.
|
||||
s.ethDialCandidates.Close()
|
||||
s.snapDialCandidates.Close()
|
||||
|
||||
// Close the engine before handler else it may cause a deadlock where
|
||||
// the heimdall is unresponsive and the syncing loop keeps waiting
|
||||
// for a response and is unable to proceed to exit `Finalize` during
|
||||
// block processing.
|
||||
s.engine.Close()
|
||||
s.handler.Stop()
|
||||
|
||||
// Then stop everything else.
|
||||
|
|
@ -834,7 +840,6 @@ func (s *Ethereum) Stop() error {
|
|||
s.txPool.Close()
|
||||
s.miner.Close()
|
||||
s.blockchain.Stop()
|
||||
s.engine.Close()
|
||||
|
||||
// Clean shutdown marker as the last thing before closing db
|
||||
s.shutdownTracker.Stop()
|
||||
|
|
|
|||
Loading…
Reference in a new issue