Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-7128

LocalJobRunner may fail due to metrics name collision

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Running Hive in local mode, I got the following failure:

      	Caused by: org.apache.hadoop.metrics2.MetricsException: Metrics source LocalJobRunnerMetrics-1090927800 already exists!
      		at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.newSourceName(DefaultMetricsSystem.java:152)
      		at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.sourceName(DefaultMetricsSystem.java:125)
      		at org.apache.hadoop.metrics2.impl.MetricsSystemImpl.register(MetricsSystemImpl.java:229)
      		at org.apache.hadoop.mapred.LocalJobRunnerMetrics.create(LocalJobRunnerMetrics.java:46)
      ...
      

      It seems that it tries to generate a unique metrics source name using a random 32-bit integer. When running some longer-lived program that runs many separate jobs (such as HS2) this can easily collide. https://en.wikipedia.org/wiki/Birthday_attack has some tables for the probabilities.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tlipcon Todd Lipcon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: