[Home]

Summary:ASTERISK-28829: app_queue: leaking stasis subscription when Redirecting call
Reporter:laszlovl (lvl)Labels:
Date Opened:2020-04-14 10:19:56Date Closed:2020-05-05 10:10:46
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_queue
Versions:16.9.0 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-25844 app_queue: Ghost channels in "core show channels" output
Environment:Attachments:
Description:Given..

* A queue
* A local channel as member in that queue
* A call to that member
* An AMI Redirect on that call

.. app_queue will permanently leak two stasis subscriptions.

In setup_stasis_subs we'll create these subscriptions:

{code}
queue_data->bridge_router = stasis_message_router_create_pool(ast_bridge_topic_all());
queue_data->channel_router = stasis_message_router_create_pool(ast_channel_topic_all());
{code}

.. which will continue to exist even after the call has hung up.

This is probably caused by the stasis subscriptions not properly tracking the masquerading process and surrogate channels, meaning {{handle_hangup}} is never called.

You can easily spot this by "core show taskprocessors" showing dozens or hundreds of "stasis/p:bridge:all" and "stasis/p:channel:all" lines even when there are no active channels.

Because a testcase says more than a thousand words, I will submit one that reproduces the problem shortly.

These hanging subscriptions (to *all* channel and bridge events) can eventually grind Asterisk to a halt. I will create a separate ticket for that and leave it at your discretion to close or merge that one.
Comments:By: Asterisk Team (asteriskteam) 2020-04-14 10:19:57.046-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: George Joseph (gjoseph) 2020-04-14 10:30:13.824-0500

Will you also be submitting a review to fix the issue?


By: laszlovl (lvl) 2020-04-14 11:23:03.008-0500

Testcase submitted at https://gerrit.asterisk.org/c/testsuite/+/14210

I will attempt to propose a patch, but I'm not sure yet if that will succeed.

By: George Joseph (gjoseph) 2020-04-14 13:43:41.420-0500

OK, thanks.  I'm going to acknowledge this issue and assign it to you.  If you decide to not submit a patch, send it back to triage and we'll open an internal issue for it.


By: Nathan Bruning (nathanb) 2020-04-22 15:08:52.835-0500

We've tracked down this issue to the root cause: there is a masquerade which changes unique id's, causing app_queue to miss the hangups.

A patch is submitted here: https://gerrit.asterisk.org/c/asterisk/+/14321
It's targetted for 16 as that's LTS, right?

Also, I believe ASTERISK-25844 would be fixed by this patch too.

By: Friendly Automation (friendly-automation) 2020-05-05 10:10:47.933-0500

Change 14321 merged by Friendly Automation:
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

[https://gerrit.asterisk.org/c/asterisk/+/14321|https://gerrit.asterisk.org/c/asterisk/+/14321]

By: Friendly Automation (friendly-automation) 2020-05-05 10:10:58.006-0500

Change 14381 merged by Friendly Automation:
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

[https://gerrit.asterisk.org/c/asterisk/+/14381|https://gerrit.asterisk.org/c/asterisk/+/14381]

By: Friendly Automation (friendly-automation) 2020-05-05 10:19:30.993-0500

Change 14382 merged by Friendly Automation:
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

[https://gerrit.asterisk.org/c/asterisk/+/14382|https://gerrit.asterisk.org/c/asterisk/+/14382]

By: Friendly Automation (friendly-automation) 2020-05-06 04:11:58.284-0500

Change 14383 merged by Joshua Colp:
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

[https://gerrit.asterisk.org/c/asterisk/+/14383|https://gerrit.asterisk.org/c/asterisk/+/14383]