[
https://issues.apache.org/jira/browse/CURATOR-518?focusedWorklogId=849743&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-849743
]
ASF GitHub Bot logged work on CURATOR-518:
------------------------------------------
Author: ASF GitHub Bot
Created on: 08/Mar/23 06:12
Start Date: 08/Mar/23 06:12
Worklog Time Spent: 10m
Work Description: kezhuw commented on PR #446:
URL: https://github.com/apache/curator/pull/446#issuecomment-1459600205
@eolivelli @tisonkun Would you mind take another look ? I reworked the fix:
1. Fix implementation of `interruptLeadership` to interrupt only if
`hasLeadership`.
2. Use `ourThread` to cancel election, this avoids immature future task
cancellation which break election loops. With help from synchronized
`taskStarted`, `taskDone`, we can certainly know next election after
`cancelElection` will see cancellation cause(e.g. session expired).
Issue Time Tracking
-------------------
Worklog Id: (was: 849743)
Time Spent: 1h 20m (was: 1h 10m)
> Curator. LeaderSelector. Two successive calls to interruptLeadership() will
> break autoRequeue.
> ----------------------------------------------------------------------------------------------
>
> Key: CURATOR-518
> URL: https://issues.apache.org/jira/browse/CURATOR-518
> Project: Apache Curator
> Issue Type: Improvement
> Components: Recipes
> Affects Versions: 4.0.1, 4.2.0
> Environment: Windows 8, JRE 1.8.0_181
> Reporter: Bulatov Oleg
> Priority: Major
> Labels: newbie
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> h1. Curator. LeaderSelector. Two successive calls to interruptLeadership()
> will break autoRequeue
> If we set autoRequeue to TRUE. But during execution interruptLeadership()
> will be called from another thread before internalRequeue() completed its
> work. Then it will break recursive call to internalRequeue(), so that client
> will not ask for leadership and get stuck.
> We can solve this problem if we check hasLeadership() before calling
> interruptLeadership(). But it is strange that such check curator library does
> not do internally.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)