[Asterisk-code-review] sla: Prevent deadlock and crash due to autoservicing. (asterisk[master])
N A
asteriskteam at digium.com
Sat Sep 24 06:02:57 CDT 2022
Hello Friendly Automation,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/c/asterisk/+/19308
to look at the new patch set (#2).
Change subject: sla: Prevent deadlock and crash due to autoservicing.
......................................................................
sla: Prevent deadlock and crash due to autoservicing.
SLAStation currently autoservices the station channel before
creating a thread to actually dial the trunk. This leads
to duplicate servicing of the channel which causes assertions,
deadlocks, crashes, and moreover not the correct behavior.
Removing the autoservice prevents the crash, but if the station
hangs up before the trunk answers, the call hangs since the hangup
was never serviced on the channel.
This is fixed by not autoservicing the channel, but instead
servicing it in the thread dialing the trunk, since it is doing
so synchronously to begin with. Instead of sleeping for 100ms
in a loop, we simply use the channel for timing, and abort
if it disappears.
The same issue also occurs with SLATrunk when a call is answered,
because ast_answer invokes ast_waitfor_nandfds. Thus, we use
ast_raw_answer instead which does not cause any conflict and allows
the call to be answered normally without thread blocking issues.
ASTERISK-29998 #close
Change-Id: Icc237d50354b5910000d2305901e86d2c87bb9d8
---
M apps/app_meetme.c
1 file changed, 48 insertions(+), 7 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/08/19308/2
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19308
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Icc237d50354b5910000d2305901e86d2c87bb9d8
Gerrit-Change-Number: 19308
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220924/5a29fdae/attachment.html>
More information about the asterisk-code-review
mailing list