Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13179

GenericOptionsParser is not thread-safe because commons-cli OptionBuilder is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • None
    • None
    • Reviewed

    Description

      I'm running into similar issues like http://stackoverflow.com/questions/22462665/is-hadoops-toorunner-thread-safe, the author's observation seem to make sense to me. However when I checked the hadoop github trunk I found the issue still not fixed.

      Chris Nauroth further investigated this issue, here's his quote:

      The root cause is that commons-cli OptionBuilder is not thread-safe.

      https://commons.apache.org/proper/commons-cli/apidocs/org/apache/commons/cl
      i/OptionBuilder.html

      According to this issue, commons-cli doesn't plan to change that and
      instead chose to document the lack of thread-safety.

      https://issues.apache.org/jira/browse/CLI-209

      I think we can solve this in Hadoop, probably with a one-line change to
      make GenericOptionsParser#buildGeneralOptions a synchronized method.

      I'll soon upload a patch for this

      Attachments

        1. HADOOP-13179-master.patch
          2 kB
          Hongbin Ma
        2. HADOOP-13179.001.patch
          1 kB
          Hongbin Ma

        Issue Links

          Activity

            People

              mahongbin Hongbin Ma
              mahongbin Hongbin Ma
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: