I have inserted some debug codes in both smack AbstractXMPPConnection.java and AbstractFromToMatchesFilter.java to better understand the sequence flow.
With reference to smack MultiUserChat.java#enter(MucEnterConfiguration) and the below captured log for aTalk debug messages while joining chat room.
Following are my observations and understandings. Hopefully these help the smack team to find out the root cause of the reply timeout problem during muc setup.
-
The initial send and receive of the disco#info are working properly without problem. The Stanza collector is able to report correctly the received reply.
-
Executing the “presence = connection.createStanzaCollectorAndSend(responseFilter, joinPresence).nextResultOrThrow(conf.getTimeout());”
I have checked and verified that createStanzaCollector() registered correctly and added the responseFilter to the collectors.
-
The #presenceInterceptor correctly receives and processes the SENT.
-
However the AbstractXMPPConnecor#invokeStanzaCollectorsAndNotifyRecvListeners(final Stanza) never get triggered even server has responded to the SENT .
The #presenceListener is also not being called to process the stanza (not sure if this is also expected or overridden by the collector filter setup).
- Exception “Attempt to invoke virtual method 'org.jxmpp.jid.Jid org.jivesoftware.smack.packet.Presence.getFrom()” from log
If the above exception is in fact reflects the actual situation, look like StanzaCollector has triggered the exception somehow, hence failed to process further the RECV .
leading to reply timeout.
I am still unable to find the location where and how the received stanza is checked against the responseFilter before invokeStanzaCollectorsAndNotifyRecvListeners. Any help?
============ aTalk log when joining chatRoom =============
08-16 12:07:29.240 D/SMACK: SENT (0):
08-16 12:07:29.250 D/SMACK: RECV (0): http://jabber.org/network/serverinfo
08-16 12:07:29.260 W/αTalk: [6] org.jivesoftware.smack.AbstractXMPPConnection.invokeStanzaCollectorsAndNotifyRe cvListeners() Collector: IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=Vg0iy-216)), : fromFilter (OrFilter: (FromMatchesFilter (full): conference.icrypto.com))
08-16 12:07:29.260 W/αTalk: [6] org.jivesoftware.smack.filter.AbstractFromToMatchesFilter.accept() Accept Stanza: IQ Stanza (query http://jabber.org/protocol/disco#info) [to=leopard@icrypto.com/atalk,from=conference.icrypto.com,id=Vg0iy-216,type=result,]
08-16 12:07:29.270 W/αTalk: [17] org.jivesoftware.smack.filter.AbstractFromToMatchesFilter.accept() Accept Stanza: Presence Stanza [to=chatroom1234@conference.icrypto.com/leopard,id=Vg0iy-215,type=available,] ### cmeng - for presenceInterceptor
08-16 12:07:29.270 D/SMACK: SENT (0): <presence to=‘chatroom1234@conference.icrypto.com/leopard’ id='Vg0iy-215’>
08-16 12:07:29.310 D/SMACK: RECV (0):
08-16 12:07:29.310 D/SMACK: RECV (0):
08-16 12:07:39.430 A/art: art/runtime/thread.cc:1116] Throwing new exception ‘Attempt to invoke virtual method 'org.jxmpp.jid.Jid org.jivesoftware.smack.packet.Presence.getFrom()’ on a null object reference’ with unexpected pending exception: org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Waited for response using: AndFilter: (StanzaTypeFilter: Presence, OrFilter: (AndFilter: (FromMatchesFilter (ignoreResourcepart): chatroom1234@conference.icrypto.com, MUCUserStatusCodeFilter: status=110), AndFilter: (FromMatchesFilter (full): chatroom1234@conference.icrypto.com/leopard, StanzaIdFilter: id=Vg0iy-215, PresenceTypeFilter: type=error))).
08-16 12:07:39.430 A/art: art/runtime/thread.cc:1116] at org.jivesoftware.smack.packet.Stanza org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(long) (StanzaCollector.java:253)