[asterisk-commits] mnicholson: branch 10 r341486 - /branches/10/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 19 16:23:21 CDT 2011


Author: mnicholson
Date: Wed Oct 19 16:23:17 2011
New Revision: 341486

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341486
Log:
Fix a performance regression introduced in r325483.

The regression was caused by a call to ast_parse_device_state() in app_queue's
ring_entry() function. The ast_parse_device_state() function eventually calls
ast_channel_get_full() with a channel name prefix which causes it to walk the
channel list causing massive lock contention and slow downs.

This patch fixes the regression by removing the call to
ast_parase_device_state() which should be unnecessary. Queue member device
state should be maintained by device state events. Some users have seen
instances where busy agents were called when they shouldn't have, which is the
reason the call to ast_parse_device_state() was added. That change appears to
have resolved that issue but also causes this performance regression. There may
still be issues with queue member status, and if so, alternative methods should
be investigated to resolve them.

AST-695

Modified:
    branches/10/apps/app_queue.c

Modified: branches/10/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_queue.c?view=diff&rev=341486&r1=341485&r2=341486
==============================================================================
--- branches/10/apps/app_queue.c (original)
+++ branches/10/apps/app_queue.c Wed Oct 19 16:23:17 2011
@@ -3052,7 +3052,6 @@
 	char tech[256];
 	char *location;
 	const char *macrocontext, *macroexten;
-	enum ast_device_state newstate;
 
 	/* on entry here, we know that tmp->chan == NULL */
 	if (tmp->member->paused) {
@@ -3077,14 +3076,6 @@
 	}
 
 	if (!qe->parent->ringinuse || !tmp->member->ignorebusy) {
-		if ((tmp->member->status == AST_DEVICE_UNKNOWN) || (tmp->member->status == AST_DEVICE_NOT_INUSE)) {
-			newstate = ast_parse_device_state(tmp->member->interface);
-			if (newstate != tmp->member->status) {
-				ast_log(LOG_ERROR, "Found a channel matching iterface %s while status was %i changed to %i\n",
-					tmp->member->interface, tmp->member->status, newstate);
-				update_status(qe->parent, tmp->member, newstate);
-			}
-		}
 		if ((tmp->member->status != AST_DEVICE_NOT_INUSE) && (tmp->member->status != AST_DEVICE_UNKNOWN)) {
 			ast_debug(1, "%s in use, can't receive call\n", tmp->interface);
 			if (qe->chan->cdr) {




More information about the asterisk-commits mailing list