I've currently got an app that has high throughput and I'm using httpClient 4.3.3 provided by Apache themselves. I have an issue where I keep getting an InterruptedIOException after a while. The cause is a ConnectionShutdownException. I'm wondering if anyone has any insight on why this would happen.
I've tracked down that the error is being thrown in the CPoolProxy line 135. It seems like the getConnection() call fails due to the fact that the poolEntry used to create the CPoolEntry is null.
Now I do have a thread that cleans up the expired and timeout connections and timeouts are set for the connections/sockets. I'm at a loss right now. Here's the stack trace:
06-20 21:45:01.424: W/System.err(22978): java.io.InterruptedIOException: Connection has been shut down
06-20 21:45:01.424: W/System.err(22978): at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:337)
06-20 21:45:01.424: W/System.err(22978): at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
06-20 21:45:01.424: W/System.err(22978): at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
06-20 21:45:01.424: W/System.err(22978): at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
06-20 21:45:01.424: W/System.err(22978): at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
06-20 21:45:01.424: W/System.err(22978): at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
06-20 21:45:01.424: W/System.err(22978): at com.loopj.android.http.core.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:98)
06-20 21:45:01.434: W/System.err(22978): at com.loopj.android.http.core.AsyncHttpRequest.run(AsyncHttpRequest.java:68)
06-20 21:45:01.434: W/System.err(22978): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
06-20 21:45:01.434: W/System.err(22978): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-20 21:45:01.434: W/System.err(22978): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
06-20 21:45:01.434: W/System.err(22978): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
06-20 21:45:01.434: W/System.err(22978): at java.lang.Thread.run(Thread.java:841)
06-20 21:45:01.434: W/System.err(22978): Caused by: org.apache.http.impl.conn.ConnectionShutdownException
06-20 21:45:01.444: W/System.err(22978): at org.apache.http.impl.conn.CPoolProxy.invoke(CPoolProxy.java:135)
06-20 21:45:01.444: W/System.err(22978): at $Proxy0.getSSLSession(Native Method)
06-20 21:45:01.444: W/System.err(22978): at org.apache.http.impl.client.DefaultUserTokenHandlerHC4.getUserToken(DefaultUserTokenHandlerHC4.java:80)
06-20 21:45:01.444: W/System.err(22978): at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:320)
06-20 21:45:01.444: W/System.err(22978): ... 12 more
Apart from this random hiccup everything works well. It happens at random and all other calls seem to continue as if nothing happens