Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4223

PigStorage using OptionBuilder is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.13.0
    • 0.14.0
    • None
    • None

    Description

      While creating Options in the PigStorage constructor via populateValidOptions(), we started using OptionBuilder to create option corresponding to "overwrite" feature. OptionBuilder overuses static variables whose state can be manipulated by multiple threads. So when PigStorage tries to create a "longOpt", there might be some other thread that might be updating "longOpt" to null with a reset on the static variables. This does not seem to be safe for use within a multithreaded context.

      Here is the ST

      Cause5:

      java.lang.IllegalArgumentException: must specify longopt

      Cause5-StackTrace:

      at org.apache.commons.cli.OptionBuilder.create(OptionBuilder.java:330)

      at org.apache.pig.builtin.PigStorage.populateValidOptions(PigStorage.java:172)

      at org.apache.pig.builtin.PigStorage.<init>(PigStorage.java:207)

      ... 36 shared with parent

      Attachments

        Activity

          People

            prkommireddi Prashant Kommireddi
            prkommireddi Prashant Kommireddi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: