I am using google cloud enpoints in my android app. When I do a post call to my backend, I sometimes see an EOFException. This does not happen always. I get this error for 5% of my requests. Also, this varies on devices. Some devices show this error more times than others. Is this a bug? Is there a workaround for this issue?
These are the jars being used by the cloud point,
google-api-client-1.14.1-beta.jar
google-api-client-android-1.14.1-beta.jar
google-http-client-1.14.1-beta.jar
google-http-client-android-1.14.1-beta.jar
google-http-client-gson-1.14.1-beta.jar
google-oauth-client-1.14.1-beta.jar
Stacktrace
06-10 03:53:45.057: W/System.err(1460): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-10 03:53:45.057: W/System.err(1460): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-10 03:53:45.057: W/System.err(1460): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
06-10 03:53:45.057: W/System.err(1460): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-10 03:53:45.057: W/System.err(1460): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-10 03:53:45.057: W/System.err(1460): at java.lang.Thread.run(Thread.java:856)
06-10 03:53:45.107: W/System.err(1460): Caused by: java.io.EOFException
06-10 03:53:45.167: W/System.err(1460): at libcore.io.Streams.readAsciiLine(Streams.java:203)
06-10 03:53:45.197: W/System.err(1460): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
06-10 03:53:45.288: W/System.err(1460): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
06-10 03:53:45.297: W/System.err(1460): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
06-10 03:53:45.397: W/System.err(1460): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
06-10 03:53:45.677: W/System.err(1460): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
06-10 03:53:46.037: W/System.err(1460): at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
06-10 03:53:46.057: W/System.err(1460): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:95)
06-10 03:53:46.057: W/System.err(1460): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
06-10 03:53:46.097: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:412)
06-10 03:53:46.198: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
06-10 03:53:46.198: W/System.err(1460): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
06-10 03:53:46.247: W/System.err(1460): at com.androidapp.android.ServerUtilities.postMessage(ServerUtilities.java:154)
Update all my jars to latest,
google-api-client-1.15.0-rc.jar
google-api-client-android-1.15.0-rc.jar
google-http-client-1.15.0-rc.jar
google-http-client-android-1.15.0-rc.jar
google-http-client-gson-1.15.0-rc.jar
google-oauth-client-1.15.0-rc.jar
Still face the same error,
Also, tried settting
System.setProperty("http.keepAlive", "false");
The error does not go away.