You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Marc Pfaff (JIRA)" <ji...@apache.org> on 2014/04/14 22:24:16 UTC

[jira] [Updated] (SLING-3502) Main job queue is not properly outdated

     [ https://issues.apache.org/jira/browse/SLING-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc Pfaff updated SLING-3502:
------------------------------

    Attachment: SLING-3502.patch

Attaching patch.

This patch makes sure, the implicit main queue is treated the same as all the other queues in terms of filtering the queue name. At least from what I can tell so far, the main queue is properly outdated, in the sense that there is no outdated queue  in the queue map index by the regular queue name. 

The only drawback I can see so far is: In the job console, the main queue is listed as _main queue_, instead of <main queue>.  Would this be a problem?

I general, I wonder if it would not be better to use a implicit main queue name that is within the allowed character range. Like sling-event-main-queue, for example.

> Main job queue is not properly outdated 
> ----------------------------------------
>
>                 Key: SLING-3502
>                 URL: https://issues.apache.org/jira/browse/SLING-3502
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Event 3.3.8
>            Reporter: Marc Pfaff
>         Attachments: SLING-3502.patch
>
>
> The default job queue called <main queue> appears not to be properly outdated.
> The JobManager keeps an internal map of currently running job queues, indexed by job name. The code to outdate a queue (JobManagerImpl.outdateQueue()) uses a filtered queue name to look up the queue to outdate in this map. But the part that uses, creates and puts the queue on the map (JobManagerImpl.process()), does not filter the queue name. 
> After outdating the main queue like this, there are two or more main queue entries in the map, depending on the number of topology changes happening, pointing to the same outdated queue instance. As one of the queues is still indexed with <main queue>, new jobs that use the main queue are always assigned an outdated queue. That's a dead end, as outdated queues do not appear to have a queue thread running no more.
> To reproduce:
> * Start one instance
> * Start a job that uses the main queue, so one instance of the main queue is created. This job passes fine. 
> * Trigger a topology change, e.g. by adding a second instance to the same topology
> * Check the job manager in sling console, you should see two outdated main queues, properly labeled as outdated, but one of them is internally still indexed by <main queue>
> * Start another job that uses the main queue. This job and all following jobs using main queue never get executed



--
This message was sent by Atlassian JIRA
(v6.2#6252)