Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forced reconnections when the HPB is not used #7080

Merged

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Mar 31, 2022

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 inCall property for the participant who is reconnecting could be not in the call when the usersInRoom signaling 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 inCall property 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)

  • Delay handling the leave call request by adding sleep(5); before
    $session = $this->participant->getSession();
  • Remove audio and video permissions by default in a conversation
  • Start a call as a moderator
  • In a private window, join the call with audio and/or video (although audio and video will be blocked)
  • In the original window, add all permissions to the other participant

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)

  • Delay handling the join call request by adding sleep(5); before
    $this->participantService->ensureOneToOneRoomIsFilled($this->room);
  • Remove audio and video permissions by default in a conversation
  • Start a call as a moderator
  • In a private window, join the call with audio and/or video (although audio and video will be blocked)
  • In the original window, add all permissions to the other participant

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.

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>
@danxuliu
Copy link
Member Author

danxuliu commented Apr 4, 2022

/backport to stable23

@nickvergessen nickvergessen merged commit 43ccc65 into master Apr 6, 2022
@nickvergessen nickvergessen deleted the fix-forced-reconnections-when-the-hpb-is-not-used branch April 6, 2022 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants