spring-projects / spring-integration-extensions

The Spring Integration Extensions project provides extension components for Spring Integration
http://www.springintegration.org/
279 stars 265 forks source link

GH-173: Leaders: Warn event errors, not re-throw #174

Closed artembilan closed 7 years ago

artembilan commented 7 years ago

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.

artembilan commented 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

garyrussell commented 7 years ago

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.

artembilan commented 7 years ago

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...

garyrussell commented 7 years ago

Oh, yeah, I missed that - I forgot that leadership events are simply application events.