You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Bill Havanki (JIRA)" <ji...@apache.org> on 2014/03/03 17:25:25 UTC

[jira] [Commented] (ACCUMULO-2270) bulk import thread pool initialized in non-static method.

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

Bill Havanki commented on ACCUMULO-2270:
----------------------------------------

That method should definitely be made {{static}} and {{private}}. However, more work needs to be done here, because there is a reference to {{threadPool}} in the {{call()}} method that is not thread-safe. Even though creation of the thread pool is synchronized, another thread may see the pool in a partially constructed state. The [lazy initialization holder class idiom|http://blog.crazybob.org/2007/01/lazy-loading-singletons.html] should be used here.

This wouldn't have been an issue in 1.4 because static code blocks give you safe publication.

> bulk import thread pool initialized in non-static method.
> ---------------------------------------------------------
>
>                 Key: ACCUMULO-2270
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2270
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>            Reporter: Keith Turner
>            Assignee: Vikram Srivastava
>         Attachments: ACCUMULO-2270.v1.patch.txt
>
>
> In 1.5 org.apache.accumulo.server.master.tableOps.BulkImport.LoadFiles has a static thread pool. This static thread pool is initialized with a non-static syncronized method.  1.4 initializes in a static code block.



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