You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2018/03/01 08:44:00 UTC

[jira] [Updated] (OAK-6891) Executions of background threads might pile up

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

Michael Dürig updated OAK-6891:
-------------------------------
    Fix Version/s: 1.9.0

> Executions of background threads might pile up
> ----------------------------------------------
>
>                 Key: OAK-6891
>                 URL: https://issues.apache.org/jira/browse/OAK-6891
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>            Reporter: Francesco Mari
>            Priority: Major
>              Labels: production
>             Fix For: 1.9.0, 1.10
>
>         Attachments: example.txt
>
>
> The background threads used in {{FileStore}} are implemented by wrapping {{Runnable}} instances in {{SafeRunnable}}, and by handing the {{SafeRunnable}} instances over to a {{ScheduledExecutorService}}. 
> The documentation of {{ScheduledExecutorService#scheduleAtFixedRate}} states that "if any execution of a task takes longer than its period, then subsequent executions may start late, but will not concurrently execute". This means that if an execution is delayed, the piled up executions might fire in rapid succession.
> This way of running the periodic background threads might not be ideal. For example, it doesn't make much sense to flush the File Store five times in a row. On the other hand, if the background tasks are coded with this caveat in mind, this issue might not be a problem at all. For example, flushing the File Store five times in a row might not be a problem if many of those executions don't do much and return quickly.
> Tasks piling up might be a problem when it comes to release the resource associated with the {{FileStore}} in a responsive way. Since the {{ScheduledExecutorService}} is gracefully shut down, it might take some time before all the scheduled background tasks are processed and the {{ScheduledExecutorService}} is ready to be terminated.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)