Connection timeouts in JEP 321 (HTTP Client)
Markus Peloquin
markpeloquin at gmail.com
Tue Jul 24 18:34:28 UTC 2018
Somebody pointed me at the upcoming HTTP client implementation, and I'm sad
to see that connection timeouts are missing from the implementation (the
old HTTP API). Is the absence of connection timeouts intended or an
oversight? I'd like to see it added, and it looks like a simple change to
me.
http://openjdk.java.net/jeps/321
http://mail.openjdk.java.net/pipermail/jdk-dev/2018-March/000996.html
There are some environments (such as AWS VPCs), where connection failures
are only indicated by a connection timeout. This is because ICMP
'Destination Unreachable' packets are often not forwarded to the client (by
load balancers, private links, etc) and there are supposedly some security
concerns with allowing them by default. Those ICMP packets give immediate
failures (net/host/protocol/port unreachable), but timeouts are slow.
The default timeout is unbounded in Java, though the TCP implementation of
the OS times-out connection establishment to around 130 seconds.
It looks like the implementation uses SocketChannel, which still supports
timeouts via chan.socket().connect(addr, timeout).
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20180724/57ad8a6f/attachment-0001.html>
More information about the net-dev
mailing list