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

tim.ringenbach at gmail.com tim.ringenbach at gmail.com
Mon Aug 2 11:44:48 CDT 2010


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

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