<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10137">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Sean Bright: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis_cache:  Stop caching stasis subscription change messages<br><br>Since app_voicemail no longer uses the cache to maintain its state<br>there is no longer a need to cache these messages.<br><br>ASTERISK-27121<br><br>Change-Id: I321c708505f5ad8d00e1b0afc4c27dc2ac12ecb4<br>---<br>M main/stasis_cache.c<br>1 file changed, 9 insertions(+), 22 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/stasis_cache.c b/main/stasis_cache.c</span><br><span>index 9907c6c..acf6fd0 100644</span><br><span>--- a/main/stasis_cache.c</span><br><span>+++ b/main/stasis_cache.c</span><br><span>@@ -817,29 +817,16 @@</span><br><span> </span><br><span>      msg_type = stasis_message_type(message);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  /*</span><br><span style="color: hsl(120, 100%, 40%);">+     * app_voicemail used to rely on the cache containing every topic subscribe and</span><br><span style="color: hsl(120, 100%, 40%);">+        * unsubscribe in order to determine if anyone was currently subscribed to a</span><br><span style="color: hsl(120, 100%, 40%);">+   * particular mailbox.  This caused the cache to grow unabated for the life of</span><br><span style="color: hsl(120, 100%, 40%);">+         * the asterisk instance.  Since it no longer needs the cache of these message</span><br><span style="color: hsl(120, 100%, 40%);">+         * types, and no other function needs them, we no longer cache them.</span><br><span style="color: hsl(120, 100%, 40%);">+   */</span><br><span>  if (stasis_subscription_change_type() == msg_type) {</span><br><span style="color: hsl(0, 100%, 40%);">-            struct stasis_subscription_change *change = stasis_message_data(message);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-               /*</span><br><span style="color: hsl(0, 100%, 40%);">-               * If this change type is an unsubscribe, we need to find the original</span><br><span style="color: hsl(0, 100%, 40%);">-           * subscribe and remove it from the cache otherwise the cache will</span><br><span style="color: hsl(0, 100%, 40%);">-               * continue to grow unabated.</span><br><span style="color: hsl(0, 100%, 40%);">-            */</span><br><span style="color: hsl(0, 100%, 40%);">-             if (strcmp(change->description, "Unsubscribe") == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     struct stasis_cache_entry *sub;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-                 ao2_wrlock(caching_topic->cache->entries);</span><br><span style="color: hsl(0, 100%, 40%);">-                        sub = cache_find(caching_topic->cache->entries, stasis_subscription_change_type(), change->uniqueid);</span><br><span style="color: hsl(0, 100%, 40%);">-                  if (sub) {</span><br><span style="color: hsl(0, 100%, 40%);">-                              cache_remove(caching_topic->cache->entries, sub, stasis_message_eid(message));</span><br><span style="color: hsl(0, 100%, 40%);">-                            ao2_cleanup(sub);</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-                       ao2_unlock(caching_topic->cache->entries);</span><br><span style="color: hsl(0, 100%, 40%);">-                        ao2_cleanup(caching_topic_needs_unref);</span><br><span style="color: hsl(0, 100%, 40%);">-                 return;</span><br><span style="color: hsl(0, 100%, 40%);">-         }</span><br><span style="color: hsl(0, 100%, 40%);">-               msg_put = message;</span><br><span style="color: hsl(0, 100%, 40%);">-              msg = message;</span><br><span style="color: hsl(120, 100%, 40%);">+                ao2_cleanup(caching_topic_needs_unref);</span><br><span style="color: hsl(120, 100%, 40%);">+               return;</span><br><span>      } else if (stasis_cache_clear_type() == msg_type) {</span><br><span>          /* Cache clear event. */</span><br><span>             msg_put = NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10137">change 10137</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10137"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I321c708505f5ad8d00e1b0afc4c27dc2ac12ecb4 </div>
<div style="display:none"> Gerrit-Change-Number: 10137 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>