Skip to content

Commit

Permalink
Use errors.Is in conductor side stopping sequencer
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Aug 19, 2024
1 parent 4af385f commit 5a330b4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions op-conductor/conductor/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,17 @@ func (oc *OpConductor) transferLeader() error {
}

func (oc *OpConductor) stopSequencer() error {
oc.log.Info("stopping sequencer", "server", oc.cons.ServerID(), "leader", oc.leader.Load(), "healthy", oc.healthy.Load(), "active", oc.seqActive.Load())
oc.log.Info(
"stopping sequencer",
"server", oc.cons.ServerID(),
"leader", oc.leader.Load(),
"healthy", oc.healthy.Load(),
"active", oc.seqActive.Load())

_, err := oc.ctrl.StopSequencer(context.Background())
if err != nil {
if strings.Contains(err.Error(), driver.ErrSequencerAlreadyStopped.Error()) {
oc.log.Warn("sequencer already stopped.", "err", err)
if errors.Is(err, driver.ErrSequencerAlreadyStopped) {
oc.log.Warn("sequencer already stopped", "err", err)
} else {
return errors.Wrap(err, "failed to stop sequencer")
}
Expand Down

0 comments on commit 5a330b4

Please sign in to comment.