If I use several XMPP connections at the same time, I often meet following problem.
Sometimes one or more account get “Exception reloading roster” and it breakes this connection.
I did not dive in deeply so far, but for now I have:
2017-01-27_18-50-55 D/Smack﹕ SENT (3):
2017-01-27_18-50-55 D/Smack﹕ RECV (3):
… 30 seconds pass …
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ Exception reloading roster
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 30000ms (~30s). Waited for response using: IQReplyFilter: iqAndIdFilter (AndFilter: (OrFilter: (IQTypeFilter: type=error, IQTypeFilter: type=result), StanzaIdFilter: id=3ovju-2492)), : fromFilter (OrFilter: (FromMatchesFilter (full): null, FromMatchesFilter (ignoreResourcepart): grigory.fedorov@creep.im, FromMatchesFilter (full): creep.im)).
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ org.jivesoftware.smack.AbstractXMPPConnection$7.run(AbstractXMPPConnection.java :1523)
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ java.util.concurrent.FutureTask.run(FutureTask.java:237)
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:272)
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
2017-01-27_18-51-25 E/org.jivesoftware.smack.roster.Roster﹕ java.lang.Thread.run(Thread.java:761)
For some reasons roster stanza does not parsed correctly.
In next reconnection (caused by network changing)
only “ConnectionListener.connected()” is called, “authenticated” does not called nether again. But “User logged (3)” successfully. Roster in not requested after reconnection.
setRosterLoadedAtLogin is set to true.
So, for some reasons “Exception reloading roster” hangs connection between “connected” and “authenticated” states. Also it look strange to have such exception if roster stanza was received correctly.
I think I never meet such problem using one connection.
I will try to look into the code of XMPPTCPConnection to better understand the problem (not sure if I can understand it though)