Fix forced reconnections when the HPB is not used#7080
Merged
nickvergessen merged 2 commits intomasterfrom Apr 6, 2022
Merged
Conversation
When the HPB is not used forced reconnections just leave and then join the call again. However, it was not waited for the call to be left first before joining it again, so it could happen that the join request ended being processed first and thus once the leave request was processed the participant did not join again. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When the HPB is not used forcing a reconnection causes the call to be left and then joined again. Although it was waited for the call to be left first before joining again in some cases it could happen that, after sending the join request but before receiving its response, the "usersInRoom" event was received. In that case the call flags for the participant will be "disconnected" (as at this point it is actually disconnected), but as the join request was already sent it is seen as "a moderator ended the call", and thus the call is left again. To prevent that now it is explicitly waited for the "disconnected" flags to be received and, then, the call is joined again. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Member
Author
|
/backport to stable23 |
nickvergessen
approved these changes
Apr 6, 2022
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 a forced reconnection is triggered and the HPB is not used there are several race conditions that can prevent the participant from automatically joining the call again, or prevent other participants to establish the connection again with that participant.
First, when the call was joined again it was not waited for the call to be left first, so it could happen that the leave and join request were sent and the join request ended being processed first, so once the leave call request was processed the participant did not join.
Second, if joining the call takes too long the
inCallproperty for the participant who is reconnecting could be not in the call when theusersInRoomsignaling message is sent. If that happens the WebUI could understand that as the call having being ended by a moderator and then cause the participant to leave the call, ignoring the response to the join request received later.Finally, if the
inCallproperty for the participant who is reconnecting never becomes not in the call other participants would not notice that the participant in fact reconnected (as without HPB the same session ID is used) and then not update their connection with that participant (for example, to stop it if the participant is no longer publishing). -> This will be fixed at a later point.Pending:
How to test (scenario 1)
sleep(5);beforespreed/lib/Controller/CallController.php
Line 164 in 56d4660
Result with this pull request
The participant in the private window leaves and then automatically joins the call again.
Result without this pull request
The participant in the private window leaves but does not join the call again.
How to test (scenario 2)
sleep(5);beforespreed/lib/Controller/CallController.php
Line 113 in 56d4660
Result with this pull request
The participant in the private window leaves and then automatically joins the call again.
Result without this pull request
The participant in the private window leaves but does not join the call again. The browser console shows Force leaving the call for current participant.