Skip to content

Commit

Permalink
reset backoff after successful connection in fedmgr (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping authored Dec 12, 2023
2 parents 4bfee6d + dd87722 commit 51ad672
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bgs/fedmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,18 @@ func (s *Slurper) subscribeWithRedialer(ctx context.Context, host *models.PDS, s

log.Info("event subscription response code: ", res.StatusCode)

curCursor := cursor
if err := s.handleConnection(ctx, host, con, &cursor, sub); err != nil {
if errors.Is(err, ErrTimeoutShutdown) {
log.Infof("shutting down pds subscription to %s, no activity after %s", host.Host, EventsTimeout)
return
}
log.Warnf("connection to %q failed: %s", host.Host, err)
}

if cursor > curCursor {
backoff = 0
}
}
}

Expand Down

0 comments on commit 51ad672

Please sign in to comment.