Skip to content

Conversation

@kfaraz
Copy link
Contributor

@kfaraz kfaraz commented Apr 16, 2025

Description

If a master node fails to acquire leadership due to exception while calling listener.becomeLeader(),
listener.stopBeingLeader() must be called in order to ensure that there are no modules which
continue to believe that they are still the leader.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@kfaraz
Copy link
Contributor Author

kfaraz commented Apr 17, 2025

Thanks for the feedback, @gianm !
I have updated the patch accordingly.

@gianm
Copy link
Contributor

gianm commented Apr 21, 2025

LGTM. Coverage checker is unhappy; is it possible/useful to add coverage, or should we ignore it? Probably the System.exit(1) piece at least isn't testable in unit tests.

@kfaraz
Copy link
Contributor Author

kfaraz commented Apr 22, 2025

Thanks for the review, @gianm !
I will try to add some coverage for the changed lines today.
If it does not seem feasible (due to the system exit calls), then I will proceed with the merge.

@kfaraz kfaraz merged commit b43d837 into apache:master Apr 22, 2025
73 of 74 checks passed
@kfaraz kfaraz deleted the cleanup_leadership branch April 22, 2025 06:30
@capistrant capistrant added this to the 34.0.0 milestone Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants