[asterisk-dev] [Code Review] StopMixMonitor race condition (not giving up file immediately)

Mark Michelson mmichelson at digium.com
Wed Jun 17 10:01:13 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/283/#review861
-----------------------------------------------------------

Ship it!


Looks good!


/trunk/doc/datastores.txt
<http://reviewboard.digium.com/r/283/#comment2114>

    This change is not accurate.


- Mark


On 2009-06-16 10:42:07, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/283/
> -----------------------------------------------------------
> 
> (Updated 2009-06-16 10:42:07)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> StopMixMonitor only indicates to the MixMonitor thread to stop writing to the file.  It does not guarantee that the recording's file handle is available to the dialplan immediately after execution.  This results in a race condition.
> 
> For Example: After StopMixMonitor, If an AGI script is used to convert a recording to another format, it may or may not have access to the file depending on how fast the MixMonitor thread closes the filestream.
> 
> To resolve this, the filestream pointer is placed in a datastore on the channel. When StopMixMonitor is called, the datastore is retrieved from the channel and the filestream is closed immediately before returning to the dialplan.  Documentation indicating the use of StopMixMonitor to free files has been updated as well.
> 
> 
> This addresses bug 15259.
>     https://issues.asterisk.org/view.php?id=15259
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_mixmonitor.c 200941 
>   /trunk/doc/datastores.txt 200941 
> 
> Diff: http://reviewboard.digium.com/r/283/diff
> 
> 
> Testing
> -------
> 
> Tested StopMixMonitor in the dialplan in both a made up extension and the 'h' extension.  Both resulted in the immediate termination of the filestream.
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list