From: Matthew Nicholson Date: Wed, 19 Oct 2011 21:23:17 +0000 (+0000) Subject: Fix a performance regression introduced in r325483. X-Git-Tag: 10.0.0-rc1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69d2d462757af13b694ba1e0cea32a64719bdde2;p=thirdparty%2Fasterisk.git 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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341486 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index d2ca97cb52..73152acf02 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3052,7 +3052,6 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies 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 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies } 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) {