KAFKA-19889 max.connections.per.ip.overrides does not apply overrides to all IPs for multi-IP hostnames #20894
+45
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fix addresses a bug where
max.connections.per.ip.overridesdoes not correctly apply the override value to all IP addresses resolved from a multi-IP hostname.Background
max.connections.per.ipcan be overridden per host using themax.connections.per.ip.overridesconfiguration.The override can be specified using either an IP address or a hostname.
When a hostname resolves to multiple IP addresses (e.g., when pointing to a load balancer or an auto-scaling group), the broker currently applies the override only to the first resolved IP address.
This occurs because the existing implementation relies on InetAddress.getByName(host), which internally returns only the first value from InetAddress.getAllByName(host).
As a result, additional backend IPs continue to use the default max.connections.per.ip value, leading to inconsistent connection limits for the same logical host.