Ticket #1942 (closed defect: fixed)

Opened 17 months ago

Last modified 17 months ago

Infinite loop when TURN allocation fails immediately

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.5.5
Component: pjnath Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

TURN session will not destroy itself after TURN allocation request fails immediately (e.g: due to network unreachable), instead it will just revert back the TURN session state to PJ_TURN_STATE_RESOLVED. While in this state, the TURN socket will simply restart the TURN allocation (so the TURN session state becomes PJ_TURN_STATE_ALLOCATING). Unfortunately this TURN allocation will fail immediately (the same way as described initially, due to network unreachable), and that is how the infinite loop of RESOLVED-ALLOCATING happens.

Thanks Nir Lavi for the report.

Change History

comment:1 Changed 17 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5375:

Fix #1942: TURN socket should not start TURN allocation in state PJ_TURN_STATE_RESOLVED when previous state is already PJ_TURN_STATE_ALLOCATING.

comment:2 Changed 17 months ago by nanang

In 5380:

Re #1942:

  • Reverted back r5375, otherwise retrying next server will not work as it is using the ALLOCATING -> RESOLVED.
  • Don't set state to RESOLVED when pj_stun_session_send_msg() fails to avoid infinite loop, simply return the error code and let application destroy the TURN client session (which is already done by TURN socket).
  • Handle allocation error when delayed allocation fails (otherwise TURN client session may never get destroyed?).
Note: See TracTickets for help on using tickets.