Closed artembilan closed 7 years ago
@garyrussell ,
I'm pretty sure that we should port the solution to other LeaderInitiator
implementations: https://jira.spring.io/browse/INT-4220
I am not sure that this is the right answer on the grant side; if the application fails to process the leader onGranted event, shouldn't we yield leadership? On the revoked side it might be less of a problem because the app might still think it's leader, but I suppose there's not much more we can do than log the exception.
Why? It is just an event. One of the listeners may process it properly, but another fail by some its own state.
For the strong leadership we require Candidate
. The LeaderEventPublisher
is optional for the LeaderInitiator
anyway...
Oh, yeah, I missed that - I forgot that leadership events are simply application events.
Fixes GH-173 (https://github.com/spring-projects/spring-integration-extensions/issues/173)
Currently when an error is thrown from the event publishing the role granting is broken and we just go to the role revoking.
try...catch
event publishing in theLeaderInitiator
andlogger.warn
anException