Commit 969382a3 authored by Lucas's avatar Lucas Committed by GitHub

op-node: Fix stop sequencer deadlock in op-conductor deployments (#13806)

* op-node: Fix stop sequencer deadlock

* fix lint
parent 9a7257ec
......@@ -672,6 +672,16 @@ func (d *Sequencer) Stop(ctx context.Context) (common.Hash, error) {
// ensure latestHead has been updated to the latest sealed/gossiped block before stopping the sequencer
for d.latestHead.Hash != d.latestSealed.Hash {
// if we are not the leader, latestSealed will never be updated and we will wait forever
if isLeader, err := d.conductor.Leader(ctx); err != nil {
d.log.Warn("Could not determine leadership while stopping. Skipping wait.", "err", err)
break
} else if !isLeader {
d.log.Info("Not leader anymore, skipping head sync wait")
break
}
latestHeadSet := make(chan struct{})
d.latestHeadSet = latestHeadSet
d.l.Unlock()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment