We ran into an issue with ReconnectionManager and stream resumption. I can reproduce with both 4.4.8 and 4.4.6. The scenario is the following:
- Enable ReconnectionManager with fixed delay 1 second
- Connect and login successfully
- Restart the XMPP server, removing the virtual domain
- Smack attempts to re-connect and gets a host-unknown error
Expected behavior:
Smack should continue to attempt to re-connect at 1 second interval.
Actual behavior:
Smack stops the re-connect attempts.
The issue only occurs when Stream Management is enabled. If we disable it, the behavior is as expected. Also, if we stop the XMPP server instead of mis-configuring it, so the TCP socket fails to connect then the behavior is as expected.
XMPPTCPConnection.setUseStreamManagementResumptionDefault(false);
XMPPTCPConnection.setUseStreamManagementDefault(false);
I suspect it has to do with ReconnectionManager running after the XMPPTCPConnection is marked as connected
here, but I don’t understand the details:
This file can help repro the problem (you need the server setup as well):