[asterisk-dev] [Code Review] fix cond_wait and doexit handling in main/db.c

Terry Wilson reviewboard at asterisk.org
Sun Jan 8 10:59:24 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1659/#review5129
-----------------------------------------------------------

Ship it!


While this is a patch that needs to go in, it only fixes one possible cause of the issue. There is absolutely nothing stopping two simultaneous asterisk -rx 'core stop gracefully' command executing and causing the crash (which I've verified on my machine). The patch in 1658 has some shortcomings. I forgot about the ability to cancel a shutdown, so stop gracefully could be run more than once, etc. So to stop fixing just symptoms of the problem, we'd need to come up with some way to not do two shutdowns in parallel. But, if there was a cancelled shutdown, that would still break anything that expected the atexit function to only run once. So the atexit functions would need to be run past a point where one could cancel a shutdown anyway.

- Terry


On Jan. 8, 2012, 6:45 a.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1659/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2012, 6:45 a.m.)
> 
> 
> Review request for Asterisk Developers and Terry Wilson.
> 
> 
> Summary
> -------
> 
> I think this is a better candidate for fixing A18883 than r1658.
> 
> Explanation in r1658 follows.
> 
> 
> This addresses bug A18883.
>     https://issues.asterisk.org/jira/browse/A18883
> 
> 
> Diffs
> -----
> 
>   branches/10/main/db.c 350018 
> 
> Diff: https://reviewboard.asterisk.org/r/1659/diff
> 
> 
> Testing
> -------
> 
> Without this patch, the selected test (realtime_sipregs) ran for 70+ seconds and got killed by the fallback kill ('core stop now' in lib/python/asterisk/asterisk.py).
> 
> With the patch, the selected test ran for 8+ seconds and got killed cleanly (by 'core stop gracefully').
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120108/dd499327/attachment.htm>


More information about the asterisk-dev mailing list