connection pool in vertx 3.4

89 views
Skip to first unread message

Josef Pfleger

unread,
Aug 23, 2017, 10:36:02 AM8/23/17
to vert.x
helo,

I have an `HttpClient` that I use to make requests to different IP addresses. I also set a host-header for these requests which is the same for all IPs. Before vertx 3.4, it worked as expected, the requests would reach different IPs with the same hostheader and there was at least one connection to each IP, managed by the connection pool. Since vertx 3.4 however, only one connection (to the first IP) is established, and subsequent requests always use that connection.

I had a look in the vertx code and think it is because before vertx 3.4, the `ConnectionManager` was pooling connection based on `TargetAddress` and since 3.4 it is pooling connections based on a `ConnectionKey` which only includes the `peerHost` (i.e. the host header if set). That means there is only one ConnectionQueue per hostname (as set in the host-header), even if requests to different IPs are made.

Am I understanding it correctly and if so, why was this change made in vertx 3.4?

thanks,
Josef

Lukas Prettenthaler

unread,
Aug 23, 2017, 11:04:15 AM8/23/17
to vert.x

Julien Viet

unread,
Aug 23, 2017, 11:14:23 AM8/23/17
to ve...@googlegroups.com
the main reason for this change is that the same IP can host multiple names (nothing new) and in case of SSL with SNI we cannot share the same connection between different host names because the different host names can have different certificates.

perhaps the connection key could be IP + Hostname in case an IP address is specified directly ?


--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/68620ee2-5cb5-4c5e-8eb9-d132f91edb0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Josef Pfleger

unread,
Aug 23, 2017, 11:25:43 AM8/23/17
to vert.x
I see, and yes, I agree, making the peerHost a combination of IP + Hostname in case of a specified IP would allow for both scenarios.

Julien Viet

unread,
Aug 23, 2017, 11:27:26 AM8/23/17
to ve...@googlegroups.com
can you open an issue for this ?

Josef Pfleger

unread,
Aug 23, 2017, 11:35:07 AM8/23/17
to vert.x
Reply all
Reply to author
Forward
0 new messages