accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Havanki (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2270) bulk import thread pool initialized in non-static method.
Date Mon, 03 Mar 2014 16:25:25 GMT

    [ 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)

Mime
View raw message