On Mon, 2021-02-22 at 15:17 -0500, Marc Boorshtein wrote:
> I'm using http client 4.5.13 and core 4.4.14 to tail logs over an
> http
> stream.  The stream receives new data every 5-10 seconds.  The
> connection
> dies after about a minute with the following exception in my logs:
> 
> javax.net.ssl.SSLException: Socket closed
>         at sun.security.ssl.Alert.createSSLException(Alert.java:127)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.TransportContext.fatal(TransportContext.java:324)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.TransportContext.fatal(TransportContext.java:267)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.TransportContext.fatal(TransportContext.java:262)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:130
> 3)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketImpl.access$300(SSLSocketImpl.java:72)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java
> :831)
> ~[?:1.8.0_282]
>         at
> org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInpu
> tBufferImpl.java:137)
> ~[httpcore-4.4.13.jar:4.4.13]
>         at
> org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInpu
> tBufferImpl.java:153)
> ~[httpcore-4.4.13.jar:4.4.13]
>         at
> org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputB
> ufferImpl.java:280)
> ~[httpcore-4.4.13.jar:4.4.13]
>         at
> org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputS
> tream.java:261)
> ~[httpcore-4.4.13.jar:4.4.13]
>         at
> org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStre
> am.java:222)
> ~[httpcore-4.4.13.jar:4.4.13]
>         at
> org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.ja
> va:183)
> ~[httpcore-4.4.13.jar:4.4.13]
>         at
> org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.j
> ava:135)
> ~[httpclient-4.5.12.jar:4.5.12]
>         at
> org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.j
> ava:148)
> ~[httpclient-4.5.12.jar:4.5.12]
>         at
> com.tremolosecurity.proxy.ConfigSys.procData(ConfigSys.java:463)
> ~[unison-server-core-1.0.21.jar:?]
>         .
>         .
>         .
> Caused by: java.net.SocketException: Socket closed
>         at java.net.SocketInputStream.socketRead0(Native Method)
> ~[?:1.8.0_282]
>         at
> java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
> ~[?:1.8.0_282]
>         at
> java.net.SocketInputStream.read(SocketInputStream.java:171)
> ~[?:1.8.0_282]
>         at
> java.net.SocketInputStream.read(SocketInputStream.java:141)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:
> 457)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocket
> InputRecord.java:68)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.ja
> va:1095)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketImpl.access$200(SSLSocketImpl.java:72)
> ~[?:1.8.0_282]
>         at
> sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java
> :815)
> ~[?:1.8.0_282]
>         ... 45 more
> 
> It consistently happens at around a minute.  I verified the issue
> isn't on
> the server side by running a curl command with the same headers
> without any
> timeout issues.  After enabling debug logging I'm noticing that
> connections
> are being shutdown from under the code reading the stream:
> 
> [2021-02-22 19:45:26,681][Thread-20] DEBUG
> PoolingHttpClientConnectionManager - Connection manager is shutting
> down
> [2021-02-22 19:45:26,681][Thread-20] DEBUG
> DefaultManagedHttpClientConnection - http-outgoing-233: Shutdown
> connection
> 
> I don't have any code that is explicitly shutting down the connection
> or
> the pool.  Nor do I have code that aborts the connection.  Is there a
> watch
> dog process that is shutting down connections? 

No, there is not. One can enable a watch-dog thread to evict expired
connections from the pool and optionally shut down connections that
have been idle for too long but there is absolutely _nothing_ in the
stock version of HttpClient shutting down active connections.

As far as I say this clearly looks like the opposite server endpoint
(or something in between) dropping the connection.

Oleg

>  Any ideas as to where to
> look to figure out what is calling the shutdown other than loading
> the code
> into a debugger and setting break
> points in PoolingHttpClientConnectionManager?
> 
> Thanks
> Marc


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to