fix: Handle a visitor node restarting. - #1307
Merged
Merged
Conversation
When the XMPP stream to a visitor node is re-established without being resumed, the node has lost the state of the MUCs that jicofo joined on it. Smack does not re-join them and it keeps reporting them as joined, so jicofo kept sending visitors to a room that it was not an occupant of anymore. Detect this, then discard the visitor room, terminate the visitors that were in it, and disconnect the node. Do not re-use a node whose XMPP connection is down. Do not keep a room that we failed to join.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1307 +/- ##
==========================================
+ Coverage 51.43% 52.88% +1.44%
==========================================
Files 132 133 +1
Lines 8457 8511 +54
Branches 1290 1293 +3
==========================================
+ Hits 4350 4501 +151
+ Misses 3496 3384 -112
- Partials 611 626 +15
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
jitsi-ci Bot
pushed a commit
to jitsi/jitsi-pr-tests-pages
that referenced
this pull request
Aug 19, 2026
damencho
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the XMPP stream to a visitor node is re-established without being resumed, the node has lost the state of the MUCs that jicofo joined on it. Smack does not re-join them, and
MultiUserChat.isJoined()keeps returning true (it is onlymyRoomJid != null, which a connection loss does not clear). Jicofo therefore believed it was still in the visitor MUC, received no presence from it, and kept redirecting new visitors there. Only a jicofo restart recovered from this.Changes
VisitorConnectionMonitor(new): one SmackConnectionListenerper visitor connection. It reports a reset onauthenticated(resumed=false), i.e. when the state on the node is gone. A stream that resumes is left alone, which matches how the main room is handled.FocusManager.visitorConnectionReset()notifies the conferences.JitsiMeetConferenceImpl.visitorConnectionReset()discards the stale visitor room, terminates the visitors that were in it, leaves the room, and sendsdisconnect-vnode. The next redirect joins a new room.selectVisitorNode()does not re-use a node whose XMPP connection is down. The fallback for when all nodes are down does not change.selectVisitorNode()removes the map entry if the join fails, or if the room is discarded while we join it. Before this a failed join left an entry that jicofo treated as joined for the rest of the conference.A visitor room that the server destroys had the same leak: the visitors in it kept a
Participantand an endpoint on a bridge. Both paths now share the cleanup.Tests
23 new tests in
ConferenceUtilTest,ConferenceVisitorsTestandVisitorConnectionMonitorTest. With the changes to the production code reverted, 8 of them fail.MockChatRoom.join()returned a relaxed mock, somainRoomJidwas never null and every conference in the tests looked like a breakout room. It now returns a realChatRoomInfo.