Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Fix Consul Lock TTL with store failure #1552

Conversation

abronan
Copy link
Contributor

@abronan abronan commented Dec 16, 2015

Fix #1545

If using the Lock TTL feature with Consul, the code
path in libkv is issuing a Put in the background through
the PeriodicRenewal call. The error is then eaten up and
ignored on the candidate loop. This would lead to the
candidate and followers being stuck in their candidate
loop. Consequence would be that they would not retry to
take the lock ending in a state with no Leader.

This patch restores an explicit error check instead of
wrongfully passing on the error to the channel before
giving it back to the caller.

Signed-off-by: Alexandre Beslic [email protected]

@abronan
Copy link
Contributor Author

abronan commented Dec 16, 2015

/cc @dtepeneu

@abronan abronan force-pushed the fix_lock_ttl_store_failure branch from 1816148 to 5a127e8 Compare December 16, 2015 23:41
If using the Lock TTL feature with Consul, the code
path in libkv is issuing a Put in the background through
the PeriodicRenewal call. The error is then eaten up and
ignored on the candidate loop. This would lead to the
candidate and followers being stuck in their candidate
loop. Consequence would be that they would not retry to
take the lock ending in a state with no Leader.

This patch restores an explicit error check instead of
wrongfully passing on the error to the channel before
giving it back to the caller.

Signed-off-by: Alexandre Beslic <[email protected]>
@abronan abronan force-pushed the fix_lock_ttl_store_failure branch from 5a127e8 to 5e8998e Compare December 16, 2015 23:46
@abronan
Copy link
Contributor Author

abronan commented Dec 17, 2015

@vieux there seems to be an issue on the network inspect test

@dongluochen
Copy link
Contributor

LGTM

1 similar comment
Copy link
Contributor

LGTM

@dtepeneu
Copy link

Thank you Alex and the entire swarm team for such a quick fix!

ChristianKniep pushed a commit to ChristianKniep/swarm that referenced this pull request Jul 27, 2017
…e_failure

Fix Consul Lock TTL with store failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants