stasis_cache: Prune stasis_subscription_change messages
authorGeorge Joseph <gjoseph@digium.com>
Thu, 30 Aug 2018 18:08:05 +0000 (12:08 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 5 Sep 2018 18:52:17 +0000 (13:52 -0500)
commit0dd8ab35321eff33024e1f45c715a2e2a6cc8d5d
tree977e36a8750817f6649360230210d3614c57e110
parent1c04b346f83768603b8939296902ce9412326891
stasis_cache: Prune stasis_subscription_change messages

The stasis cache provides a way to reconstruct the current state
of topic subscribers.  Unfortunately, since every subscribe and
unsubscribe is cached, the cache continues to grow unabated while
asterisk is running.  This patch removes subscribe messages from
the cache when the corresponding unsubscribe is received.

This patch also registers the cache containers with ao2 so that if
AO2_DEBUG is turned on, you can list the container and get its
stats from the CLI.

ASTERISK-27121

Change-Id: I3d18905e477f3721815da91f30da8d3fbb2d4f56
main/stasis_cache.c