Skip to content

Fix deadlock on 3-way closing and optimized a bit with codec sync

Wenpeng Song requested to merge deadlock-fix-0914 into devel
  • fix the deadlock issue on 3-way closing.
    Inside the lock pvt_lock(sub->parent),ast_channel_lock(ast) after getting the rtp_stats is waiting for another lock from channel.c(ast_indicate_data) that coming in between to be unlocked. However, the lock of (ast_indicate_data) was waiting for the pvt_lock(sub->parent).
  • remove the extra 'unlock' in the function chan_voicemngr_modify_codec
    ast_channel_bridge_peer required to be unlocked which is not easy to handle here, so using AST_LIST_TRAVERSE instead.
  • optimized a bit with the condition for return in the function chan_voicemngr_modify_codec
    the condition for the incoming call that has no bridge at the time calling this function is not needed for now, as a default codec has been set based on the negotiated result when calling the local channel.
  • Avoid future potential deadlock with the same reason around chan_voicemngr_modify_codec
Edited by Wenpeng Song

Merge request reports