[asterisk-dev] [Code Review] 4341: stasis transfers: fix race condition on set replace channel
Scott Griepentrog
reviewboard at asterisk.org
Tue Jan 20 18:07:30 CST 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4341/
-----------------------------------------------------------
(Updated Jan. 20, 2015, 6:07 p.m.)
Review request for Asterisk Developers.
Changes
-------
Added removal of swap from bridge after discussion with Richard
Bugs: ASTERISK-24649
https://issues.asterisk.org/jira/browse/ASTERISK-24649
Repository: Asterisk
Description
-------
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.
Diffs (updated)
-----
/branches/13/res/stasis/stasis_bridge.c 430394
/branches/13/res/stasis/app.c 430394
Diff: https://reviewboard.asterisk.org/r/4341/diff/
Testing
-------
The stasis start/end tests that discovered the issue are now passing, and I've not found any other test failures.
Thanks,
Scott Griepentrog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150121/7d48892f/attachment.html>
More information about the asterisk-dev
mailing list