Review Board 1.7.16

Fix caching topic shutdown assertions

Review Request #2675 - Created July 15, 2013 and submitted

David Lee
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.
Tests pass without asserting.
Review request changed
Updated (Aug. 27, 2013, 2:15 p.m.)
  • changed from pending to submitted
Committed in revision 397815 runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to