Hadoop Common
  1. Hadoop Common
  2. HADOOP-8684

Deadlock between WritableComparator and WritableComparable

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 3.0.0
    • Fix Version/s: 0.23.4, 2.0.3-alpha
    • Component/s: io
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Classes implementing WriableComparable in Hadoop call the method WritableComparator.define() in their static initializers. This means, the classes call the method define() while thier class loading, under locking their class objects. And, the method WritableComparator.define() locks the WritableComaprator class object.

      On the other hand, WritableComparator.get() also locks the WritableComparator class object, and the method may create instances of the targeted comparable class, involving loading the targeted comparable class if any. This means, the method might try to lock the targeted comparable class object under locking the WritableComparator class object.

      There are reversed orders of locking objects, and you might fall in deadlock.

      1. WritableComparatorDeadLockTestApp.java
        2 kB
        Hiroshi Ikeda
      2. Hadoop-8684.patch
        3 kB
        Jing Zhao
      3. Hadoop-8684.patch
        3 kB
        Jing Zhao
      4. Hadoop-8684.patch
        3 kB
        Jing Zhao
      5. Hadoop-8684.patch
        3 kB
        Jing Zhao
      6. Hadoop-8684.patch
        2 kB
        Jing Zhao

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jing Zhao
            Reporter:
            Hiroshi Ikeda
          • Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development