-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
reconnect_backoff_max_ms
does not work in case Kafka cluster drops
#1945
Comments
Apologies if the documentation is confusing. This is the expected behavior. The purpose of this maximum is to put some reasonable cap on the reconnect time so that once a cluster recovers, clients will be expected to initiate a reconnect within this maximum time. Otherwise, if we allowed exponential backoff with no maximum, a cluster could recover and a reconnect timeout may have grown to multiple days or weeks -- meaning the client would stay disconnected despite cluster recovery.
|
But why is there no notification to the application using the SDK that it's stuck in a reconnect loop? |
Is there a way to get notified or identify when the connection breaks and the client keeps infinitely reconnecting? |
When the Kafka cluster goes down, the KafkaClient will try to reconnect forever and will not fail after the
reconnect_backoff_max_ms
have elapsed.Reproduce: Run the following code while Kafka is available:
Then while it's running, take Kafka down.
Expected behavior: After
reconnect_backoff_max_ms
have elapsed, the client should fail / an exception should be thrown.Actual behavior:
for message in consumer:
is stuck infinitelyThe text was updated successfully, but these errors were encountered: