> On Jan. 23, 2014, 11:22 a.m., opticron wrote:
> > /branches/11/main/cel.c, line 228
> > <https://reviewboard.asterisk.org/r/3127/diff/1/?file=52916#file52916line228>
> >
> >     The locking and unlocking here seems excessive. Is there a reason to 
> > maintain the lock beyond iterator creation?

The locking is necessary.  Any access to the container must be protected by 
reload_lock.  Using iterators still accesses the container so the lock must be 
held while calling iterator functions.

Releasing the lock for CLI output is a good thing because the IO functions 
could take a long time to complete.  This is why I changed the code to use 
iterators instead of just using ao2_callback().


- rmudgett


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


On Jan. 14, 2014, 4:24 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3127/
> -----------------------------------------------------------
> 
> (Updated Jan. 14, 2014, 4:24 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: AST-1253
>     https://issues.asterisk.org/jira/browse/AST-1253
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> The CEL data structures need to be protected during a configuration reload 
> and shutdown.  Asterisk crashed during a shutdown because CEL events were 
> still in flight and the CEL data structures were already destroyed.
> 
> * Protected the appset and linkedids ao2 containers using the reload_lock.  
> As a result appset, linkedids, and held objects don't need a lock.
> 
> * Added NULL checks before use of the appset and linkedids ao2 containers in 
> case the CEL module is already shutdown.
> 
> * Fixed overloading of the linkedids held objects reference count.  During 
> shutdown any held objects would be leaked.
> 
> * Fixed memory leak of linkedids held objects if the LINKEDID_END is not 
> being tracked.  The objects in the linkedids container were not removed if 
> the LINKEDID_END event is not used.
> 
> * Added access protection to the appset container during the CLI "cel show 
> status" command.
> 
> * Made CEL config reload not set defaults if the cel.conf file is invalid.
> 
> 
> Diffs
> -----
> 
>   /branches/11/main/cel.c 405542 
> 
> Diff: https://reviewboard.asterisk.org/r/3127/diff/
> 
> 
> Testing
> -------
> 
> * Checked CLI "cel show status" output was as expected.
> * Checked CEL logs for APP_START/APP_END/LINKEDID_END events after a call.
> * Shutdown asterisk with "core stop now" and "core stop gracefully" without 
> any crashes.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to