zakaria90 / gcm

Automatically exported from code.google.com/p/gcm
Apache License 2.0
0 stars 0 forks source link

socketread0 hanging thread when calling send() #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. java.net.socketinputstream.socketread0 hanging thread when calling 
send(Message, List<String>, int)

2.
main" prio=10 tid=0x000000005f871800 nid=0x3cc7 runnable [0x00002b18a0f03000]
   java.lang.Thread.State: RUNNABLE
   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)        - locked <0x00000000fe0b57e0> (a java.lang.Object)
   at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:787)        
   at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)        - locked <0x00000000f0228768> (a com.sun.net.ssl.internal.ssl.AppInputStream)
   at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)        
   at java.io.BufferedInputStream.read(BufferedInputStream.java:317)        - locked <0x00000000f278a658> (a java.io.BufferedInputStream)
   at sun.net.www.http.ChunkedInputStream.fastRead(ChunkedInputStream.java:221)        
   at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:662)        - locked <0x00000000f278cf30> (a sun.net.www.http.ChunkedInputStream)
   at java.io.FilterInputStream.read(FilterInputStream.java:116)
   at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:2668)
   at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
   at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
   at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)        - locked <0x00000000f278e1b0> (a java.io.InputStreamReader)
   at java.io.InputStreamReader.read(InputStreamReader.java:167)
   at java.io.BufferedReader.fill(BufferedReader.java:136)
   at java.io.BufferedReader.readLine(BufferedReader.java:299)        - locked <0x00000000f278e1b0> (a java.io.InputStreamReader)
   at java.io.BufferedReader.readLine(BufferedReader.java:362)
   at com.google.android.gcm.server.Sender.getString(Sender.java:539)
   at com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:369)
   at com.google.android.gcm.server.Sender.send(Sender.java:261)

What is the expected output? What do you see instead?
It's expected that the Sender retry or exception when hanging socketRead0.

What version of the product are you using? On what operating system?
1.0.2 on CentOS 64bits

Please provide any additional information below.
Attached a patch to fix the issue, I'll add a git clone soon.

Original issue reported on code.google.com by jeongha....@gmail.com on 26 Feb 2013 at 3:48