Review Board 1.7.16


stasis transfers: fix race condition on set replace channel

Review Request #4341 - Created Jan. 15, 2015 and submitted

Scott Griepentrog
13, trunk
ASTERISK-24649
Reviewers
asterisk-dev
Asterisk
After a transfer completes that uses a local replacement channel, stasis receives the stasis transfer message with the details of the transfer and makes changes on the replacement channel.  However, since a separate thread was already started for the purpose of starting stasis on the new replacement channel, this allowed for a race condition.  Occasionally later then normal arrival of the stasis transfer message would result in the stasis app name not being set on the replacement channel before it was needed by the other thread, causing it to fail to start stasis and hang up.

This change moves the operations (assignment of the stasis app name and setting the replacement snapshot on the new channel) into the bridge_stasis_push() callback from the bridge transfer logic.  This allows these steps to be completed earlier and more deterministically, eliminating the race condition.
The stasis start/end tests that discovered the issue are now passing, and I've not found any other test failures.
Total:
2
Open:
0
Resolved:
2
Dropped:
0
Status:
From:
Review request changed
Updated (Jan. 22, 2015, 12:23 p.m.)
  • changed from pending to submitted
Committed in revision 430956

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.