[Home]

Summary:ASTERISK-12195: "queue show" shows old (cached) information, whilst "queue show QUEUENAME" shows current information when using realtime.
Reporter:Nick Barnes (bcnit)Labels:
Date Opened:2008-06-14 07:54:55Date Closed:2008-07-08 15:11:59
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) queue_show.patch
Description:Whenever 'queue show' is used, realtime is not queried for any updates.
When 'queue show QUEUENAME' is used, it is.

This is defined in apps/app_queue.c:

/* We only want to load realtime queues when a specific queue is asked for. */
if (argc == 3)  /* specific queue */
  load_realtime_queue(argv[2]);

I appreciate that this has been deliberately coded this way, but in my opinion, this is erroneous behaviour.

If realtime information is not loaded for each queue, then the output of 'queue show' is just plain wrong and can't be relied on - the command simply becomes useless.

The response to bug ASTERISK-1248556 was that the AMI should be used to collect status information. At the moment, one must be aware of each queue name in order to retrieve status information for it - The problem is that third party applications cannot report on the status of queues using the AMI without having this knowledge (i.e. access to the realtime data store). In addition, even if they were aware of this, they would have to make one 'queue show QUEUENAME' call for each of the queues they require information on - this is clearly inefficient at best.

I believe that the fact that 'queue show' returns incorrect information should be considered a bug.
Comments:By: Mark Michelson (mmichelson) 2008-06-19 18:58:24

I asked on the #asterisk-bugs IRC channel if there was some cited reason for why a realtime queue is only retrieved when one is specifically requested. Unfortunately, all that did was open a can of worms about the flaws of realtime in general in Asterisk. Not very productive.

Anyway, my opinion on the matter is that using cached information is not a good idea. Since I never got any good response from other developers explaining why it was coded the way it was, I'm just going to change it, since Asterisk is perfectly capable of retrieving all the realtime data.

By: Mark Michelson (mmichelson) 2008-06-20 12:28:27

Here's a patch that will make "queue show" retrieve realtime queue information even if no queue is specified.

By: Mark Michelson (mmichelson) 2008-06-26 15:20:01

I've given this patch a few tests and it is working properly, so I am going to go ahead and get it merged in. It's a simple enough patch that I'm confident there aren't any problems with it. Although I suppose a statement like that is a sure way to shoot myself in the foot :)

Anyway, I'm closing this as soon as the code is merged.

By: Digium Subversion (svnbot) 2008-06-26 15:48:44

Repository: asterisk
Revision: 125476

U   branches/1.4/apps/app_queue.c

------------------------------------------------------------------------
r125476 | mmichelson | 2008-06-26 15:48:42 -0500 (Thu, 26 Jun 2008) | 11 lines

Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue ASTERISK-12195)
Reported by: bcnit
Patches:
     queue_show.patch uploaded by putnopvut (license 60)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=125476

By: Digium Subversion (svnbot) 2008-06-26 15:50:30

Repository: asterisk
Revision: 125477

U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r125477 | mmichelson | 2008-06-26 15:50:29 -0500 (Thu, 26 Jun 2008) | 19 lines

Merged revisions 125476 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125476 | mmichelson | 2008-06-26 15:56:01 -0500 (Thu, 26 Jun 2008) | 11 lines

Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue ASTERISK-12195)
Reported by: bcnit
Patches:
     queue_show.patch uploaded by putnopvut (license 60)


........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=125477

By: Digium Subversion (svnbot) 2008-06-26 15:51:39

Repository: asterisk
Revision: 125478

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_queue.c

------------------------------------------------------------------------
r125478 | mmichelson | 2008-06-26 15:51:39 -0500 (Thu, 26 Jun 2008) | 27 lines

Merged revisions 125477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r125477 | mmichelson | 2008-06-26 15:57:41 -0500 (Thu, 26 Jun 2008) | 19 lines

Merged revisions 125476 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125476 | mmichelson | 2008-06-26 15:56:01 -0500 (Thu, 26 Jun 2008) | 11 lines

Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue ASTERISK-12195)
Reported by: bcnit
Patches:
     queue_show.patch uploaded by putnopvut (license 60)


........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=125478

By: Digium Subversion (svnbot) 2008-06-26 16:00:15

Repository: asterisk
Revision: 125479

_U  team/seanbright/resolve-shadow-warnings/
U   team/seanbright/resolve-shadow-warnings/apps/app_queue.c

------------------------------------------------------------------------
r125479 | seanbright | 2008-06-26 15:59:57 -0500 (Thu, 26 Jun 2008) | 84 lines

Merged revisions 125332-125333,125385-125386,125438,125477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r125332 | russell | 2008-06-26 11:37:01 -0400 (Thu, 26 Jun 2008) | 5 lines

- add get_max_rate timing API call
- change ast_settimeout() to honor max rate in edge cases of file playback
 (this will make some warning messages go away at the end of playing back
  a file)

................
r125333 | kpfleming | 2008-06-26 11:50:07 -0400 (Thu, 26 Jun 2008) | 13 lines

Merged revisions 125327 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125327 | kpfleming | 2008-06-26 10:30:33 -0500 (Thu, 26 Jun 2008) | 5 lines

ensure that (whenever possible) if we generate a log message because an ioctl() call to DAHDI/Zaptel failed, that we include the reason it failed by including the stringified error number

(issue AST-80)


........

................
r125385 | oej | 2008-06-26 12:54:22 -0400 (Thu, 26 Jun 2008) | 12 lines


Merged revisions 125384 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125384 | oej | 2008-06-26 18:32:08 +0200 (Tor, 26 Jun 2008) | 3 lines

Add support for peer realm based auth (a few missing lines, the rest is well documented but never worked)


........

................
r125386 | tilghman | 2008-06-26 13:06:17 -0400 (Thu, 26 Jun 2008) | 6 lines

Convert casts to unions, to fix alignment issues on Solaris
(closes issue ASTERISK-12263)
Reported by: snuffy
Patches:
      bug_12932_20080627.diff uploaded by snuffy (license 35)

................
r125438 | tilghman | 2008-06-26 13:40:25 -0400 (Thu, 26 Jun 2008) | 6 lines

Don't play "your message has been saved" twice.
(closes issue ASTERISK-12228)
Reported by: jaroth
Patches:
      duplicate_saved.patch uploaded by jaroth (license 50)

................
r125477 | mmichelson | 2008-06-26 16:57:41 -0400 (Thu, 26 Jun 2008) | 19 lines

Merged revisions 125476 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125476 | mmichelson | 2008-06-26 15:56:01 -0500 (Thu, 26 Jun 2008) | 11 lines

Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue ASTERISK-12195)
Reported by: bcnit
Patches:
     queue_show.patch uploaded by putnopvut (license 60)


........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=125479

By: Nick Barnes (bcnit) 2008-07-03 10:38:46

When applied against 1.6.0b9, this patch causes a compilation error:

make[1]: Entering directory `/usr/src/asterisk/1.6.0b9/asterisk-1.6.0-beta9/apps'
  [CC] app_queue.c -> app_queue.o
app_queue.c: In function â__queues_showâ:
app_queue.c:5284: error: âSENTINELâ undeclared (first use in this function)
app_queue.c:5284: error: (Each undeclared identifier is reported only once
app_queue.c:5284: error: for each function it appears in.)
make[1]: *** [app_queue.o] Error 1
make[1]: Leaving directory `/usr/src/asterisk/1.6.0b9/asterisk-1.6.0-beta9/apps'
make: *** [apps] Error 2


By: Mark Michelson (mmichelson) 2008-07-08 15:11:54

Sorry, for some reason I missed your note when you mentioned the compilation error. I fixed this when I actually committed to the 1.6.0 branch. Just change the SENTINEL to NULL and your compilation error should go away.

Closing again.