Intermittent Connection Reset by Peer errors in Android connecting to .NET REST endpoint
Asked Answered
B

1

8

I'm getting intermittent errors from devices connecting to my IIS REST service via SSL. My app works just fine, but sometimes I get this exception. It is handled properly and does not bring down app..

ut I wonder what does it mean and if there any way to fix it? Currently it causes delays in data retreived. Also, it floods logs and I can't really ignore it.. I wonder if I can better this situation.

Is this something I should expect when I deal with REST services? My server is on Amazon EC2.

Read error: ssl=0x1211a88: I/O error during system call, Connection reset by peer

javax.net.ssl.SSLException: Read error: ssl=0x1211a88: I/O error during system call, Connection reset by peer at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:671) at libcore.io.Streams.readSingleByte(Streams.java:41) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:655) at libcore.io.Streams.readAsciiLine(Streams.java:201) at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:544) at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:784) at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274) at libcore.net.http.HttpURLConnectionImpl.getResponseMessage(HttpURLConnectionImpl.java:475) at libcore.net.http.HttpsURLConnectionImpl.getResponseMessage

This is NOT something I can reproduce. Not permissions or onaything like this. This is intermittent problem. I see about 1000 of those every day from 200 devices connecting every minute.

Band answered 13/6, 2012 at 18:57 Comment(10)
I can only say that "REST services" are not the issue reason.Diecious
Also check the #8473056Diecious
I'm pretty sure it is not, I just wanted to point out that it is MY service and if there is possibility that it's a server-side issue then I can somehow remedy it. I feel like it is just a communication issues, but I see lots of it and wonder if someone had experience..Band
I've seen that other question (Searched all over). Accepted answer is to "handle" it. I do it already. My question about minimizing occurences if possible.Band
I got your points. Sorry, I'm out of ideas.Diecious
Does this happen over packet radio (2g/3g/4g etc), WIFI, or both?Trina
I don't know. But most of my customers on "packet" radioBand
Is it happening when the user is idle for a long time before coming to the app?Wardmote
It is possible, but I can't be sure.Band
Read this for the complete explanation and possible resolution: #30539140Haruspex
A
1

It seems like a timeout issue occurring on the client side causing for this exception on your server side. I've seen this happening on an upload method I have on my service, since it takes sometime to upload the file the chances the mobile will move between networks are quite high and that might cause this issue.

I would examine the following solutions:

  1. Try and figure if its a certain mobile device manufacturer that causes your logs to flood with those exceptions. I've experienced cases where the manufacturer network handling was behaving differently from other brands. In case you do find that there is a specific brand causing this you might extend the default timeout on that specific device or further investigate and try to reproduce on that device.
  2. I would also examine if the clients causing those exceptions are timed out because of a latency issue for that specific called method. maybe certain customers are experiencing a certain performance issue while calling a certain method. If it is a performance issue you probably going to fix it on the server side and there is no use of investigating the client side.

Please update if you have any further details.

Arthur answered 4/1, 2015 at 19:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.