Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer version check until after bootstrap succeeds #1426

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Mar 9, 2018

Separated from #1411 . This PR moves version checking from __init__ into _bootstrap . This means that if a cluster is down and bootstrapping fails, version checking will not cause an exception to be raised immediately. Instead, we wait until the initial bootstrap succeeds and then run version checks. In order to handle this I've changed the "unset" version from None to (0, 0). This also allows us to simplify version checking code internally. (0, 0) should cause us to use the lowest available version (likely 0.8.2) if needed but still flag that version checking has not yet happened.


This change is Reviewable


Raises:
NodeNotReadyError (if node_id is provided)
NoBrokersAvailable (if node_id is None)
Copy link
Contributor

@jeffwidman jeffwidman Mar 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what happens if bootstrapping eventually fails? Will these still get raised somewhere else in the stack?

I know there's code in the wild that is expecting these exceptions, as I used it myself when I updated the Datadog kafka consumer lag check to use the async KafkaClient instead of the old SimpleClient before we had the new KafkaAdminClient.

To clarify, I'm not against this change, I just want to understand the new behavior.

@jeffwidman
Copy link
Contributor

jeffwidman commented Mar 16, 2018

I like this PR's goal of creating a stronger separation btween the "liveness" check from the "which version" check.

@jeffwidman
Copy link
Contributor

What's needed to push this across the line?

@dpkp
Copy link
Owner Author

dpkp commented Nov 20, 2018

Going to leave this out of 1.4.X patch release as it seems like a largish change. Will land for next release.

@jeffwidman jeffwidman added this to the 2.0 milestone Jan 3, 2019
@kurtmckee
Copy link
Contributor

Did this land in 2.0?

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