[asterisk-dev] [Code Review] 2675: Fix caching topic shutdown assertions

Matt Jordan reviewboard at asterisk.org
Tue Jul 16 08:41:00 CDT 2013


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

Ship it!


Ship It!

- Matt Jordan


On July 15, 2013, 9:13 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2675/
> -----------------------------------------------------------
> 
> (Updated July 15, 2013, 9:13 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> The recent changes to update stasis_cache_topics directly from the
> publisher thread uncovered a race condition, which was causing asserts
> in the /stasis/core tests.
> 
> If the caching topic's subscription is the last reference to the
> caching topic, it will destroy the caching topic after the final
> message has been processed. When dispatching to a different thread,
> this usually gave the unsubscribe enough time to finish before
> destruction happened. Now, however, it consistently destroys before
> unsubscription is complete.
> 
> This patch adds an extra reference to the caching topic, to hold it
> for the duration of the unsubscription.
> 
> This patch also removes an extra unref that was happening when the
> final message was received by the caching topic. It was put there
> because of an extra ref that was put into the caching topic's
> constructor. Both have been removed, which makes the destructor a bit
> less confusing.
> 
> 
> Diffs
> -----
> 
>   /trunk/main/stasis_cache.c 394395 
> 
> Diff: https://reviewboard.asterisk.org/r/2675/diff/
> 
> 
> Testing
> -------
> 
> Tests pass without asserting.
> 
> 
> Thanks,
> 
> David Lee
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130716/79f0b2b2/attachment.htm>


More information about the asterisk-dev mailing list