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

Fixed race condition between session timer and call disconnection #3494

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

sauwming
Copy link
Member

@sauwming sauwming commented Apr 6, 2023

To fix #2732.

I can reproduce it on my machine with the reported scenario:

  • A calls B, session timer enabled
  • B answers the call
  • B hangs up at the same time of session refresh timer

When trying to perform session refresh, A will assert in pjsip_inv_update(): inv->state < PJSIP_INV_STATE_DISCONNECTED.

Note that the issue doesn't happen when A is the one hanging up the call since the session timer will be ended upon calling pjsip_inv_end_session() here:
https://github.com/pjsip/pjproject/blob/master/pjsip/src/pjsip-ua/sip_inv.c#L2925

So the proposed patch is to end the session timer upon receipt of incoming BYE.

Additionally, we can also consider to remove the assertion in pjsip_inv_update() if state is DISCONNECTED and return normal error instead.

@sauwming sauwming merged commit 79b4a3d into master Apr 11, 2023
34 checks passed
@sauwming sauwming deleted the timer-race branch April 11, 2023 10:16
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.

Assertion failure when checking inv state
3 participants