Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1942 closed defect (fixed)

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 (2)

comment:1 Changed 8 years ago by nanang

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

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 8 years 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.