Skip to content
Snippets Groups Projects
  • Joshua Colp's avatar
    5caefc98
    chan_sip: Destroy peers without holding peers container lock. · 5caefc98
    Joshua Colp authored
    Due to the use of stasis_unsubscribe_and_join in the peer destructor
    it is possible for a deadlock to occur when an event callback is
    occurring at the same time.
    
    This happens because the peer may be destroyed while holding the
    peers container lock. If this occurs the event callback will never
    be able to acquire the container lock and the unsubscribe will
    never complete.
    
    This change makes it so the peers that have been removed from the
    peers container are not destroyed with the container lock held.
    
    ASTERISK-25163 #close
    
    Change-Id: Ic6bf1d9da4310142a4d196c45ddefb99317d9a33
    5caefc98
    History
    chan_sip: Destroy peers without holding peers container lock.
    Joshua Colp authored
    Due to the use of stasis_unsubscribe_and_join in the peer destructor
    it is possible for a deadlock to occur when an event callback is
    occurring at the same time.
    
    This happens because the peer may be destroyed while holding the
    peers container lock. If this occurs the event callback will never
    be able to acquire the container lock and the unsubscribe will
    never complete.
    
    This change makes it so the peers that have been removed from the
    peers container are not destroyed with the container lock held.
    
    ASTERISK-25163 #close
    
    Change-Id: Ic6bf1d9da4310142a4d196c45ddefb99317d9a33