[asterisk-dev] [Code Review] __ast_play_and_record randomize prepend file
tim.ringenbach at gmail.com
tim.ringenbach at gmail.com
Tue Aug 17 11:33:48 CDT 2010
> On 2010-08-03 10:57:34, Russell Bryant wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/main/app.c, lines 738-746
> > <https://reviewboard.asterisk.org/r/833/diff/2/?file=12049#file12049line738>
> >
> > 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?
I didn't know about ast_random(), and I was worried about being unlucky and the random filename already existing. I saw that app_voicemail was using mkstemp().
But yeah, how I'm doing it is kind of awkward, I'll change it to just use ast_random().
- tim_ringenbach
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/833/#review2519
-----------------------------------------------------------
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