Summary:ASTERISK-26013: Multiple queued calls sent to agent
Reporter:Richard Miller (ulogic)Labels:
Date Opened:2016-05-11 14:55:20Date Closed:2016-05-12 04:51:49
Versions:11.22.0 Frequency of
duplicatesASTERISK-16115 [patch] problem with ringinuse=no, queue members receive sometimes two calls
Environment:CentOS 6.4Attachments:
Description:This is the scenario.  An agent is logged into multiple queues.  The queues are all set up with autofill on, ringinuse off, and a ring strategy of leastrecent.  The queues and members are in realtime ODBC storage.

The CEL occasionally shows two calls firing off to a single agent within 100 microseconds.  Typically, the calls come from different queues, but occasionally both calls come from the same queue.

The problem is that the architecture depends on device state information to know when an agent is in use, but with fast multicore processors, another thread can detect the same agent as the next to notify before the device state changes.  There is a window between wait_our_turn() and try_calling() where this can happen.  I think the way to resolve it, depending on the ring strategy, is for wait_our_turn() to attach a member to a queue entry while both chains are locked.

The loophole size can be reduced but not completely closed if get_member_status() tests the member->call_pending state.

I am looking for some feedback or comments before working on a patch.
Comments:By: Asterisk Team (asteriskteam) 2016-05-11 14:55:21.519-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].

By: Joshua C. Colp (jcolp) 2016-05-11 15:02:10.541-0500

This has already been fixed recently. It has not yet landed in a release but will be in the next one.

By: Richard Miller (ulogic) 2016-05-11 21:46:36.970-0500

Thanks for the update.  That is one less item that I need to work on.  I look forward to the next release.

By: Asterisk Team (asteriskteam) 2016-05-11 21:46:37.181-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.