[asterisk-dev] [Code Review] __ast_play_and_record randomize prepend file

Russell Bryant russell at digium.com
Tue Aug 3 10:57:34 CDT 2010


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



http://svn.asterisk.org/svn/asterisk/trunk/main/app.c
<https://reviewboard.asterisk.org/r/833/#comment5546>

    If all you're trying to do is generate a unique filename, why not just use ast_random() to generate that part of the string?


- Russell


On 2010-08-02 11:44:48, tim_ringenbach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/833/
> -----------------------------------------------------------
> 
> (Updated 2010-08-02 11:44:48)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> A customer of Asteria had a problem with asterisk getting stuck channels and nearly locking up the entire box that seemed related to forwarding voicemail. I tracked the problem down to some kind of race condition in __ast_play_and_record() where the prepend file was renamed to the real file while some other thread still had it opened, and would end up stuck in the while() look copying frames to and from the same file forever, resulting in really high IO and a file that continually grows.
> 
> This patch fixes the issue by randomizing the filename prepeded to.
> 
> 
> Diffs
> -----
> 
>   http://svn.asterisk.org/svn/asterisk/trunk/main/app.c 280658 
> 
> Diff: https://reviewboard.asterisk.org/r/833/diff
> 
> 
> Testing
> -------
> 
> I only tested the patch against the version the custom was running, which was 1.6.1.18.
> I was able to reproduce the issue by creating some dialplan and call files to make local channels dial into voicemail main and use SendDTMF to make them forward voicemail while prepeding a message. If I threw 250 call files out, I got around a dozen stuck channels.
> 
> After the patch, no channels were stuck despite running the same stress test.
> 
> 
> Thanks,
> 
> tim_ringenbach
> 
>




More information about the asterisk-dev mailing list