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

JobEndNotifier isnt synchronized, doesnt check state before acting

    XMLWordPrintableJSON

    Details

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

      Description

      JobEndNotifier is pretty hazardous inside.

      1. the static startNotifier isnt synchronized, and doesnt check for being already running before it creates a new worker thread. It should be sycnhronized and a no-op if there is a live thread.

      2. stopNotifier() should be a no-op if already stopped. It MUST NOT call thread.interrupt() in such a state, as thread may be null.

      3. the registerNotification method also assumes that the static queue is non null.

      Things would be a lot safer by making this class part of a JobTracker, not a singleton with static methods, as then you could more safely make assumptions about object state. This would not only eliminate a lot of reentrancy problems, but tie the life of the notifier to that of its owner, the JobTracker.

        Attachments

        1. hadoop-3415.patch
          0.5 kB
          Steve Loughran

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                stevel@apache.org Steve Loughran
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: