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 2016/02/19 12:30:18 UTC

[jira] [Commented] (OAK-4025) Reuse ExecutorUtils to shutdown ExecutorService

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

Michael Dürig commented on OAK-4025:
------------------------------------

Patch LGTM. 

There is another issue though: the invariant specified for {{ExecutorCloser.close()}} is not guaranteed to hold:

{quote}
It ensures that executor is properly closed once the call from close is returned. 
{quote}

Either {{ExecutorService.awaitTermination()}} returning {{false}} or throwing an exception will cause a call to {{ExecutorService.shutdownNow()}} in the subsequent finally block. At this point there is no more waiting for for running tasks to terminate thus violating said invariant. 

cc [~chetanm]

> Reuse ExecutorUtils to shutdown ExecutorService
> -----------------------------------------------
>
>                 Key: OAK-4025
>                 URL: https://issues.apache.org/jira/browse/OAK-4025
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.3.16
>            Reporter: Davide Giannella
>            Assignee: Davide Giannella
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: OAK-4025-1.patch
>
>
> A utility class ExecutorUtils has been created in oak-commons. It provides a convenience method for gracefully shutdown an ExecutorService.
> For code clean-up reuse it in ExecutorCloser.java and AtomicCounterEditorProvider.java.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)