No response from Gcm after setting up the first connection

966 views
Skip to first unread message

Sakis Kaliakoudas

unread,
May 19, 2015, 7:00:57 PM5/19/15
to andro...@googlegroups.com
Hello, 


I have a back-end server that initiates 10 connections at startup within a couple of seconds. And that used to work great.. until a week ago. Now we get the following exception from smack



org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Used filter: No filter used or filter was 'null'.
    at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:106) ~[smack-core-4.1.0.jar:4.1.0]
    at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:85) ~[smack-core-4.1.0.jar:4.1.0]
    at org.jivesoftware.smack.SynchronizationPoint.checkForResponse(SynchronizationPoint.java:192) ~[smack-core-4.1.0.jar:4.1.0]
    at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait(SynchronizationPoint.java:114) ~[smack-core-4.1.0.jar:4.1.0]
    at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow(SynchronizationPoint.java:97) ~[smack-core-4.1.0.jar:4.1.0]
    at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:837) ~[smack-tcp-4.1.0.jar:4.1.0]
    at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:360) ~[smack-core-4.1.0.jar:4.1.0]
    at com.follower.service.msg.gcm.cache.connection.GcmXMPPTCPConnectionLauncher.connect(GcmXMPPTCPConnectionLauncher.java:67) ~[classes/:na]


May 20, 2015 1:15:20 AM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection closed with error
java.io.EOFException: input contained no data
    at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003)
    at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
    at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410)
    at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
    at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
    at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1151)
    at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:937)
    at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:952)
    at java.lang.Thread.run(Thread.java:745)

right after the first connection is created. This means that I can only create a single connection as GCM does not reply to further new connection requests . I tried raising the timeout from 5 seconds to 30 but I still get the same timeout.

I see that on the first connection request smack is logging a debug message being sent to google:

01:50:45 AM SENT (0): <stream:stream xmlns='jabber:client' to='gcm.googleapis.com' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

which is followed by a response that seems to initiate the connection binding process:

01:50:45 AM RECV (0): <stream:stream from="gcm.googleapis.com" id="E3249E63F9154730" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
01:50:45 AM RECV (0): <stream:features><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>X-OAUTH2</mechanism><mechanism>X-GOOGLE-TOKEN</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
(..then further messages are exchanged, and the connection is finally created..)

but on the second connection when the same request is sent:

01:50:45 AM SENT (1): <stream:stream xmlns='jabber:client' to='gcm.googleapis.com' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

nothing is received back.

Any ideas on why this is happening? Mind you that I made no changes to my back-end server, so this has to be a GCM issue that has just been introduced.

Dennis Li

unread,
May 27, 2015, 8:38:57 PM5/27/15
to andro...@googlegroups.com
I am seeing the same thing. It seems that only 1 connection is allowed per app server now.

Costin Manolache

unread,
May 28, 2015, 12:20:04 AM5/28/15
to andro...@googlegroups.com
We are working on this bug - as a workaround until this is fixed I suggest disabling TLS session caching/reuse, for example
by making sure a new TLS context is used on each connection. The problem seems to affect multiple connections
made from the same process when the TLS context and session are reused. Connections made from different 
processes should not be affected.

Costin

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/016f0e93-30f7-45c4-b6bf-f859caddcb8b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages