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

sia agent - exit when refresh fails after configured number of attempts #2148

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

havetisyan
Copy link
Collaborator

let's assume we have a setup where the certs are issued for 7 days and refresh daily (default behavior).
when SIA refreshes the certs and the certificate signer is down, the refresh will fail. This will cause the sia container to exit and a new one is created. however, the cert signer might be down for a so our sia container keeps restarting. however, the existing key/cert pair is valid for at least 6 days, so there is no reason to exit.

now, we have a configurable value with default setting of 2. this means we won't be exiting if we fail to refresh our certs, instead, we'll just ignore the failure and try again tomorrow. If after 2 refresh operations, we still fail, we'll exit.

In addition, when we fail, we also check if the cert will expire before the next rotation. So even if the fail count is below the limit, if the next refresh will be too late, we'll exit as well so that the container can keep trying to fetch new certs periodically.

@havetisyan havetisyan merged commit 0532b14 into master Apr 28, 2023
@havetisyan havetisyan deleted the fail-count branch April 28, 2023 22:33
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

Successfully merging this pull request may close these issues.

2 participants