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

JobHistory does not escape literal jobName when used in a regex pattern

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.19.0
    • Fix Version/s: 0.19.0
    • Component/s: None
    • Labels:
      None

      Description

      JobHistory#getJobHistoryFileName throws a PatternSyntaxException if the jobName includes characters that could be regex metacharacters or metasequences and are subsequently considered malformed.

      Trace:
      Exception in thread "initJobs" java.util.regex.PatternSyntaxException: Unclosed character class near index 97
      ....
      at java.util.regex.Pattern.error(Pattern.java:1713)
      at java.util.regex.Pattern.clazz(Pattern.java:2254)
      at java.util.regex.Pattern.clazz(Pattern.java:2210)
      at java.util.regex.Pattern.sequence(Pattern.java:1818)
      at java.util.regex.Pattern.expr(Pattern.java:1752)
      at java.util.regex.Pattern.compile(Pattern.java:1460)
      at java.util.regex.Pattern.<init>(Pattern.java:1133)
      at java.util.regex.Pattern.compile(Pattern.java:823)
      at org.apache.hadoop.mapred.JobHistory$JobInfo.getJobHistoryFileName(JobHistory.java:632)
      at org.apache.hadoop.mapred.JobHistory$JobInfo.finalizeRecovery(JobHistory.java:740)
      at org.apache.hadoop.mapred.JobTracker.finalizeJob(JobTracker.java:1532)
      at org.apache.hadoop.mapred.JobInProgress.garbageCollect(JobInProgress.java:2232)
      at org.apache.hadoop.mapred.JobInProgress.terminateJob(JobInProgress.java:1938)
      at org.apache.hadoop.mapred.JobInProgress.terminate(JobInProgress.java:1953)
      at org.apache.hadoop.mapred.JobInProgress.fail(JobInProgress.java:2012)
      at org.apache.hadoop.mapred.EagerTaskInitializationListener$JobInitThread.run(EagerTaskInitializationListener.java:62)
      at java.lang.Thread.run(Thread.java:637)

        Attachments

        1. hadoop-4498-v3.patch
          5 kB
          Chris Wensel
        2. hadoop-4498-v2.patch
          5 kB
          Chris Wensel
        3. hadoop-4498.patch
          0.8 kB
          Chris Wensel

          Issue Links

            Activity

              People

              • Assignee:
                cwensel Chris Wensel
                Reporter:
                cwensel Chris Wensel
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: