You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Ruslan Al-Fakikh (JIRA)" <ji...@apache.org> on 2014/09/09 13:10:28 UTC

[jira] [Commented] (HADOOP-10436) ToolRunner is not thread-safe

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

Ruslan Al-Fakikh commented on HADOOP-10436:
-------------------------------------------

The issue is resolved in a newer version of CLI:
https://issues.apache.org/jira/browse/CLI-224
So, OptionBuilder is deprecated there. I think we just need to use the new Option.Builder from here:
https://fisheye6.atlassian.com/changelog/commons?cs=1444720

> ToolRunner is not thread-safe
> -----------------------------
>
>                 Key: HADOOP-10436
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10436
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>            Reporter: Ajay Chitre
>            Assignee: Tsuyoshi OZAWA
>         Attachments: HADOOP-10436.1.patch
>
>
> ToolRunner class is not thread-safe because it uses GenericOptionsParser.  The constructor of GenericOptionsParser uses 'OptionBuilder' which is a singleton class that uses instance variables.  In other words, OptionBuilder is NOT thread safe.  As a result, when multiple Hadoop jobs are triggered simultaneously using ToolRunner they end up stepping on each other.
> The easiest way to fix it is by making 'buildGeneralOptions' synchronized in GenericOptionsParser.
> private static synchronized Options buildGeneralOptions(Options opts) {
> If this seems like the correct way of fixing this, either we can provide a patch or someone can quickly fix it.  Thanks.
> Ajay Chitre
> achitre@cisco.com
> Virendra Singh
> virsingh@cisco.com



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