Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1256] HTTPClient breaking app on timeout on Android

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-07-18T06:58:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid
ReporterReuben Turk
AssigneeShuo Liang
Created2014-07-17T06:24:01.000+0000
Updated2016-03-08T07:37:38.000+0000

Description

When doing a GET request with Titanium.Network.HTTPClient, on iOS when I get a timeout it calls the onerror callback, I handle it and the app moves on, but on android it calls the onerror callback but then throws these errors and my app basically stops what it is doing there:
[ERROR] :  TiHttpClient: (TiHttpClient-4) [5036,16911] HTTP Error (java.net.SocketTimeoutException): java.net.SocketTimeoutException
[ERROR] :  TiHttpClient: java.net.SocketTimeoutException
[ERROR] :  TiHttpClient: 	at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
[ERROR] :  TiHttpClient: 	at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
[ERROR] :  TiHttpClient: 	at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:191)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:82)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:180)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259)
[ERROR] :  TiHttpClient: 	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279)
[ERROR] :  TiHttpClient: 	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:428)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:653)
[ERROR] :  TiHttpClient: 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637)
[ERROR] :  TiHttpClient: 	at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1287)
[ERROR] :  TiHttpClient: 	at java.lang.Thread.run(Thread.java:818)
I can continue using the app after that, however the processing that was happening with the HTTPClient calls doesn't finish properly.

Comments

  1. Shuo Liang 2014-07-17

    Hi, Would you please provider us a simple test case for this problem, that will be really helpful to address the problem. Regards, Shuo
  2. Shuo Liang 2014-07-17

    HI, Never mind, Please ignore the last comment. I made a test case myself. Can you tell me what's your meaning of "however the processing that was happening with the HTTPClient calls doesn't finish properly". During my test case, all the actions of error call back will be triggered(even the error pop out in console), and app will keep running. So could you please explain "doesn't finish properly". thanks Regards Shuo
  3. Reuben Turk 2014-07-18

    Thanks for your response. Actually after some further debugging it is an issue with my code. The program does continue on after these errors as expected. This can be closed as cannot reproduce or something.

JSON Source