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

Increase default authentication timeout #1340

Merged
merged 1 commit into from
May 2, 2022

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented May 2, 2022

The Java client and librdkafka have a single timeout configuration value for connection establishment, which includes the entire operation of TCP socket connection, protocol negotiation and authentication. However, they work slightly differently:

  • Java client - initial timeout is 10s, but it has a retry mechanism with exponential backoff with another max value of 30s
  • librdkafka - default timeout of 30s. No backoff mechanism.
  • kafkajs - has a TCP socket connection timeout of 1s, also has an overall connection establishment timeout of 2 * connectionTimeout + authenticationTimeout, where authenticationTimeout is 1s. This means that in practice our equivalent timeout is 3 seconds. This PR changes that to effectively be 12 seconds, bringing it more in line with the other clients.

I considered going full librdkafka and setting it to 30 seconds, but it's much easier to increase defaults than to decrease them if we want to change things in the future. Just setting the authentication timeout to 10s is probably going to solve most people's issues regardless.

Relates to #1332

Brings it more in line with the Java client and librdkafka. The configuration
values for those clients are a bit different, where a single configuration
value is used as a "total timeout for socket establishment", instead
of having one configuration value for TCP socket connection and one
for authentication. KIP-601 goes into this in more detail.

This change does not make KafkaJS work the same way, but it does set the
default to a more sane value.
@Nevon Nevon merged commit 74f8c6a into master May 2, 2022
@Nevon Nevon deleted the increase-default-authentication-timeout branch May 2, 2022 14:37
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.

1 participant