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:1303)
~[?: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(SessionInputBufferImpl.java:137)
~[httpcore-4.4.13.jar:4.4.13]
at
org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
~[httpcore-4.4.13.jar:4.4.13]
at
org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
~[httpcore-4.4.13.jar:4.4.13]
at
org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:261)
~[httpcore-4.4.13.jar:4.4.13]
at
org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:222)
~[httpcore-4.4.13.jar:4.4.13]
at
org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:183)
~[httpcore-4.4.13.jar:4.4.13]
at
org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
~[httpclient-4.5.12.jar:4.5.12]
at
org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java: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(SSLSocketInputRecord.java:68)
~[?:1.8.0_282]
at
sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java: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? 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