[ 
https://issues.apache.org/jira/browse/SLING-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13906349#comment-13906349
 ] 

Alexander Klimetschek commented on SLING-3392:
----------------------------------------------

AFAICS, in the current solution it still has a flat list and needs to iterate 
it completely to find out the oldest ones which could be anywhere in the list 
(I assume it's not ordered).

You could use a date + time based structure for the nested hierarchy. Have 
buckets in minutes or whatever is appropriate to keep it minimized. Then 
deletion is really simple - just delete all the buckets that are older than 3 
minutes.

{code}
/var/eventing/jobs/locks
    + 2014-02-19_12:20
        + job1
        + job2
    + 2014-02-19_12:21
        + job3
        + job4
    + 2014-02-19_12:22
        + job5
    + 2014-02-19_12:23
        + job6
{code}
(date + timestamps would be UTC)

> JobManager MaintenanceTask should not rely on search for removing locks
> -----------------------------------------------------------------------
>
>                 Key: SLING-3392
>                 URL: https://issues.apache.org/jira/browse/SLING-3392
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Event 3.3.4
>            Reporter: Amit Gupta
>            Assignee: Carsten Ziegeler
>             Fix For: Event 3.3.6
>
>
> org.apache.sling.event.impl.jobs.MaintenanceTask relies on search to find 
> obsolete locks and remove those.
> Search can fail for reasons such as index corruption. It should not rely on 
> search for such critical tasks.
> And, another issue with locks is that those are created in a flat hierarchy.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to