Skip to content

Fix HTTP client load balancing for multi-homed hosts - #6270

Open
arnabnandy7 wants to merge 1 commit into
eclipse-vertx:masterfrom
arnabnandy7:fix/http-client-multihomed-load-balancing
Open

Fix HTTP client load balancing for multi-homed hosts#6270
arnabnandy7 wants to merge 1 commit into
eclipse-vertx:masterfrom
arnabnandy7:fix/http-client-multihomed-load-balancing

Conversation

@arnabnandy7

Copy link
Copy Markdown

Motivation:

An HttpClient configured with a LoadBalancer resolved every address for a multi-homed host, but requests still connected to only one IP.

The resolved InetAddress instances retained the original hostname. As a result, the generated SocketAddress instances compared equally and shared the same connection-pool key, despite representing different IP addresses.

This change creates socket addresses using the resolved numeric IP while retaining the original InetAddress. Each resolved IP therefore receives a distinct connection pool and can be selected by the configured load balancer.

The existing DNS client-side load-balancing test now also verifies that DNS results produce distinct server addresses.

Fixes #6200

Conformance:

I have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md

I have followed the Vert.x code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines

Verification:

mvn -pl vertx-core -Dtest=Http1xTest#testDnsClientSideLoadBalancingEnabled test

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
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.

HttpClient with a LoadBalancer uses only one IP for a multi-homed host

1 participant