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

svnbot reviewboard at asterisk.org
Thu Jul 18 09:08:24 CDT 2013

This is an automatically generated e-mail. To reply, visit:

(Updated July 18, 2013, 9:08 a.m.)


This change has been marked as submitted.

Review request for Asterisk Developers.


Committed in revision 394686

Repository: Asterisk


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.


  /trunk/main/stasis_cache.c 394395 

Diff: https://reviewboard.asterisk.org/r/2675/diff/


Tests pass without asserting.


David Lee

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

More information about the asterisk-dev mailing list