Skip to content

Commit

Permalink
Don't shutdown if we lose leadership during lease restoration (#4924)
Browse files Browse the repository at this point in the history
* Don't shutdown if we lose leadership during lease restoration

* Update comment
  • Loading branch information
briankassouf authored Jul 13, 2018
1 parent 9c258c7 commit 146a684
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vault/expiration.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ func (m *ExpirationManager) Restore(errorFunc func()) (retErr error) {

switch {
case retErr == nil:
case errwrap.Contains(retErr, context.Canceled.Error()):
// Don't run error func because we lost leadership
m.logger.Warn("context cancled while restoring leases, stopping lease loading")
retErr = nil
case errwrap.Contains(retErr, ErrBarrierSealed.Error()):
// Don't run error func because we're likely already shutting down
m.logger.Warn("barrier sealed while restoring leases, stopping lease loading")
Expand Down

0 comments on commit 146a684

Please sign in to comment.