Skip to content

Commit

Permalink
p2p/nodestate: fix deadlock during shutdown of les server (ethereum#2…
Browse files Browse the repository at this point in the history
…1927)

This PR fixes a deadlock reported here: ethereum#21925

The cause is that many operations may be pending, but if the close happens, only one of them gets awoken and exits, the others remain waiting for a signal that never comes.
  • Loading branch information
holiman authored and rjl493456442 committed Dec 14, 2020
1 parent c466013 commit 0b41c8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/nodestate/nodestate.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ func (ns *NodeStateMachine) opFinish() {
}
ns.opPending = nil
ns.opFlag = false
ns.opWait.Signal()
ns.opWait.Broadcast()
}

// Operation calls the given function as an operation callback. This allows the caller
Expand Down

0 comments on commit 0b41c8e

Please sign in to comment.