mirror of https://github.com/apache/nifi.git
NIFI-8969: Fix Maximum Polling Time in CuratorLeaderElectionManager
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #5270.
This commit is contained in:
parent
3621a2182c
commit
44f7a2f5b5
|
@ -330,8 +330,8 @@ public class CuratorLeaderElectionManager implements LeaderElectionManager {
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
final long minNanos = aggregation.getMin();
|
final long maxNanos = aggregation.getMax();
|
||||||
return timeUnit.convert(minNanos, TimeUnit.NANOSECONDS);
|
return timeUnit.convert(maxNanos, TimeUnit.NANOSECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -578,7 +578,6 @@ public class CuratorLeaderElectionManager implements LeaderElectionManager {
|
||||||
listener.onLeaderElection();
|
listener.onLeaderElection();
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
logger.error("This node was elected Leader for Role '{}' but failed to take leadership. Will relinquish leadership role. Failure was due to: {}", roleName, e);
|
logger.error("This node was elected Leader for Role '{}' but failed to take leadership. Will relinquish leadership role. Failure was due to: {}", roleName, e);
|
||||||
logger.error("", e);
|
|
||||||
setLeader(false);
|
setLeader(false);
|
||||||
Thread.sleep(1000L);
|
Thread.sleep(1000L);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue