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

KAFKA-12193: Re-resolve IPs after a client disconnects #10061

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

bob-barrett
Copy link
Contributor

This patch changes the NetworkClient behavior to resolve the target node's hostname after disconnecting from an established connection, rather than waiting until the previously-resolved addresses are exhausted. This is to handle the scenario when the node's IP addresses have changed during the lifetime of the connection, and means that the client does not have to try to connect to invalid IP addresses until it has tried each address.

Reviewers: Mickael Maison mickael.maison@gmail.com, Satish Duggana satishd@apache.org, David Jacot djacot@confluent.io

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

This patch changes the NetworkClient behavior to resolve the target node's hostname after disconnecting from an established connection, rather than waiting until the previously-resolved addresses are exhausted. This is to handle the scenario when the node's IP addresses have changed during the lifetime of the connection, and means that the client does not have to try to connect to invalid IP addresses until it has tried each address.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Satish Duggana <satishd@apache.org>, David Jacot <djacot@confluent.io>
@bob-barrett bob-barrett changed the title KAFKA-12193: Re-resolve IPs after a client disconnects (#9902) KAFKA-12193: Re-resolve IPs after a client disconnects Feb 4, 2021
@bob-barrett
Copy link
Contributor Author

@dajac This is the backport of 131d475. The conflicts were because the connection timeout settings added by KIP-601 aren't present in 2.6. This didn't change the behavior of this patch, but it did require a slight change in NetworkClientTest#testFailedConnectionToFirstAddress to simulate a failed connection, since sleeping for the connection timeout wasn't an option.

Copy link
Contributor

@dajac dajac left a comment

Choose a reason for hiding this comment

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

LGTM

@dajac dajac merged commit c3cb3f7 into apache:2.6 Feb 5, 2021
@dajac
Copy link
Contributor

dajac commented Feb 5, 2021

@ableegoldman FYI - We have backported this fix to 2.6.

udaynpusa pushed a commit to mapr/kafka that referenced this pull request Jan 30, 2024
…pache#10061)

This patch changes the NetworkClient behavior to resolve the target node's hostname after disconnecting from an established connection, rather than waiting until the previously-resolved addresses are exhausted. This is to handle the scenario when the node's IP addresses have changed during the lifetime of the connection, and means that the client does not have to try to connect to invalid IP addresses until it has tried each address.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Satish Duggana <satishd@apache.org>, David Jacot <djacot@confluent.io>
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.

2 participants