Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.3.3
-
None
Description
According to http://docs.oracle.com/javase/8/docs/api/java/net/StandardSocketOptions.html#SO_LINGER linger option is disabled by default. Currently if SocketConfig.soLinger is set to zero (default value is -1), then Socket.setSoLinger(false, 0) will be called, so linger will be disabled, which is undesirable. Zero SO_LINGER timeout is the essential feature for HttpClient, without it we will fall into one of two options:
1. With disabled SO_LINGER all system sockets can fall into TIME_WAIT status and client will stuck
2. With enabled non-zero SO_LINGER client will wait up to 1 second at AbstractConnPool.getPoolEntryBlocking (Line 230) while closing expired connections under lock (this lock is already held by PoolingEntryFuture.get(), so there is no quick fix to release this lock for other threads)
I had encountered both of these issues on live systems.
I understand that this change will break backward compatibility of config interpretation, but can we have this in 4.4?