emran396 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Socket Read timeouts in google-api-java-client #733

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client - 1.10.2

Java environment - Java 6

Starting December 2012, we are noticing some socket read timeouts in the Google 
java client google-api-client-1.10.2 in requests that fetch events from a 
single calendar. This does not happen for all requests but some fraction of 
requests. The client code on our end fetches all calendars for a user and 
spawns separate request threads to fetch events from each calendar in parallel. 
The outgoing requests go through a company firewall and a proxy server before 
reaching Google.

The stack trace is -
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
    at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:830)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:787)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:695)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
    at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
    at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:91)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:895)
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.execute(GoogleJsonResponseException.java:198)
    at com.google.api.client.googleapis.services.GoogleClient.executeUnparsed(GoogleClient.java:237)
    at com.google.api.client.http.json.JsonHttpRequest.executeUnparsed(JsonHttpRequest.java:207)
    at com.google.api.services.calendar.Calendar$Events$List.execute(Calendar.java:3233)

Any pointers in troubleshooting will be helpful. What is the likely cause for 
the connection break/timeout? 

Thanks
Shruti

Original issue reported on code.google.com by shruti.p...@gmail.com on 26 Feb 2013 at 1:09

GoogleCodeExporter commented 9 years ago
Hi Shruti,

Apologies for the difficulties you're having.  At this time, we are not able to 
reproduce this as an issue on our end.  I suggest posting your question and 
details on StackOverflow for more personalized support.  You can use the tag 
[google-api-java-client].  For more information, check out our support page: 
https://code.google.com/p/google-api-java-client/wiki/Support

You may also want to take a look at increasing the read timeout by using 
setReadTimeout. More info here: 
https://code.google.com/p/google-api-java-client/wiki/FAQ#How_to_set_read/connec
t_timeouts_using_the_generated_libraries

Original comment by ngmic...@google.com on 27 Feb 2013 at 2:38