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

Persist check state for TTL checks #1009

Merged
merged 7 commits into from
Jun 8, 2015
Merged

Persist check state for TTL checks #1009

merged 7 commits into from
Jun 8, 2015

Conversation

ryanuber
Copy link
Member

@ryanuber ryanuber commented Jun 6, 2015

TTL checks work on the assumption that there is an external app calling in to Consul to "ping" the check, keeping it healthy. During a Consul restart, the current behavior is to re-register the check directly into a pre-determined state. This can leave the TTL-based checks in an undesirable state for an extended period of time, depending on the TTL.

This change persists the last submitted status into the data directory. The check status, output, and an expiration timestamp are all written to disk, and restored on later agent starts. During startup, if the persisted status is still "fresh" enough (the expiration timer is based on the TTL of the check), the state and output are restored and registered as the initial status of the check.

I think we could do something similar for the other check types, but since Consul has the ability to actively run those checks, we might solve it in a different way.

Fixes #1001

@armon
Copy link
Member

armon commented Jun 6, 2015

LGTM!

ryanuber added a commit that referenced this pull request Jun 8, 2015
Persist check state for TTL checks
@ryanuber ryanuber merged commit 6fe5941 into master Jun 8, 2015
@ryanuber ryanuber deleted the f-persist-status branch June 8, 2015 16:35
@blalor
Copy link
Contributor

blalor commented Jun 8, 2015 via email

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.

3 participants