Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When leadership is lost while leases are being restored make sure we don't shutdown #5046

Closed
briankassouf opened this issue Aug 3, 2018 · 2 comments
Milestone

Comments

@briankassouf
Copy link
Contributor

For some reason this check isn't working

vault/vault/expiration.go

Lines 308 to 323 in bb180b8

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")
retErr = nil
default:
m.logger.Error("error restoring leases", "error", retErr)
if errorFunc != nil {
errorFunc()
}
}

Continuation of #4915

@jefferai
Copy link
Member

jefferai commented Aug 4, 2018

Contains checks if the given error contains an error with the message msg. If err is not a wrapped error, this will always return false unless the error itself happens to match this msg.

Probably the error message is not actually matching -- either there isn't a wrapped error matching that, or the error itself isn't. Those should probably be strings.Contains.

@jefferai
Copy link
Member

jefferai commented Aug 4, 2018

Well, or figure out what the error actually is, make sure it's not matching, and then figure out why it's not matching :-)

@jefferai jefferai modified the milestones: 0.10.5 , 0.11 Aug 13, 2018
@chrishoffman chrishoffman added this to the 0.11 milestone Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants