Skip to content

Commit

Permalink
Fix node panicing during shutdown. (algorand#2043)
Browse files Browse the repository at this point in the history
Fix node panicing during shutdown due to unsynchronized compactcert database access.
  • Loading branch information
tsachiherman authored Apr 6, 2021
1 parent 80b77bd commit df68026
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ func (node *AlgorandFullNode) Stop() {
defer func() {
node.mu.Unlock()
node.waitMonitoringRoutines()
// we want to shut down the compactCert last, since the oldKeyDeletionThread might depend on it when making the
// call to LatestSigsFromThisNode.
node.compactCert.Shutdown()
node.compactCert = nil
}()

node.net.ClearHandlers()
Expand All @@ -429,7 +433,6 @@ func (node *AlgorandFullNode) Stop() {
node.lowPriorityCryptoVerificationPool.Shutdown()
node.cryptoPool.Shutdown()
node.cancelCtx()
node.compactCert.Shutdown()
if node.indexer != nil {
node.indexer.Shutdown()
}
Expand Down

0 comments on commit df68026

Please sign in to comment.