powered by Jive Software

Improper timeout config when joining HUGE MUCs


#1

So there is this really really huge MUC at #matrix#matrix.org@bridge.xmpp.matrix.org, with currently ~5300 occupants. When I attempt to join it, the first issue is that the domain does not advertise MUC and the multiUserChatManager.providesMucService(mucService) check fails.

Once that is circumvented, though, the regular MUC join timeout of 30s times out. I don’t want to make this timeout huge by default, because other MUCs aren’t that huge. And on the other hand, it would be much more useful to have a timeout that means “when no more data comes in from the MUC for X seconds”, and not “when the join isn’t completed in X seconds”.

Ideas? Suggestions?


#2

The timeout of the stanza collector waiting for the self presence on MUC join should reset for every presence (message?) received from the MUC. This is a pattern already used in some parts of Smack, e.g. MAM.


#3

Uh, and please show a stacktrace of the NoResponseException (I assume) exception you are seeing, so that I can cross check that what I think is happening actually is happening.


#4
org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 30000ms (~30s). Waited for response using: AndFilter: (StanzaTypeFilter: Presence, OrFilter: (AndFilter: (FromMatchesFilter (ignoreResourcepart): #matrix#matrix.org@bridge.xmpp.matrix.org, MUCUserStatusCodeFilter: status=110), AndFilter: (FromMatchesFilter (full): #matrix#matrix.org@bridge.xmpp.matrix.org/mobile, StanzaIdFilter: id=As1wl-184, PresenceTypeFilter: type=error))).
	at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:265)
	at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:376)
	at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:745)
	at org.yaxim.androidclient.service.SmackableImp.joinRoom(SmackableImp.java:2342)
	at org.yaxim.androidclient.service.SmackableImp.access$4700(SmackableImp.java:114)
	at org.yaxim.androidclient.service.SmackableImp$15.run(SmackableImp.java:2273)

#5

Created SMACK-859.

I have (quickly) hacked together

in case you want to test and report back. Which would be greatly appreciated as I hadn’t had a chance to test it.


#6

Speaking of which, the timeout value in the exception text is incorrect. It doesn’t come from the nextResultOrThrow() parameter but from connection.getReplyTimeout() called out of SmackException.getWaitingFor()`. With the super-precise value this comes as a surprise. And it would probably suffice to round it to seconds anyway.