jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Updated] (OAK-6891) Executions of background threads might pile up
Date Thu, 02 Nov 2017 10:31:00 GMT

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

Michael Dürig updated OAK-6891:
-------------------------------
    Labels: production  (was: )

> 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.8
>
>         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
(v6.4.14#64029)

Mime
View raw message