Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-17334

FSEditLogAsync#enqueueEdit does not synchronized this before invoke wait method

    XMLWordPrintableJSON

Details

    Description

      In method FSEditLogAsync#enqueueEdit , there exist the below codes:

              if (Thread.holdsLock(this)) {
                // if queue is full, synchronized caller must immediately relinquish
                // the monitor before re-offering to avoid deadlock with sync thread
                // which needs the monitor to write transactions.
                int permits = overflowMutex.drainPermits();
                try {
                  do {
                    this.wait(1000); // will be notified by next logSync.
                  } while (!editPendingQ.offer(edit));
                } finally {
                  overflowMutex.release(permits);
                }
              }  

      It maybe invoke this.wait(1000) without having object this's monitor.

       

      Attachments

        Issue Links

          Activity

            People

              zhanghaobo farmmamba
              zhanghaobo farmmamba
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: