From 3f98c937a16b4ae4793b49a68b9ddb0c621f1827 Mon Sep 17 00:00:00 2001 From: Matthew Nicholson Date: Wed, 19 Oct 2011 21:24:07 +0000 Subject: [PATCH] Merged revisions 341486 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/10 ........ r341486 | mnicholson | 2011-10-19 16:23:17 -0500 (Wed, 19 Oct 2011) | 18 lines 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/trunk@341487 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index f1bcb8b48d..3e75d39916 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3076,7 +3076,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) { @@ -3101,14 +3100,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) {