ZanderXu created HDFS-16787:
-------------------------------

             Summary: Remove redundant lock in DataSetLockManager#removeLock in 
datanode.
                 Key: HDFS-16787
                 URL: https://issues.apache.org/jira/browse/HDFS-16787
             Project: Hadoop HDFS
          Issue Type: Improvement
            Reporter: ZanderXu
            Assignee: ZanderXu


During patching the datanode fine-grained locking, found there is a redundant 
lock in DataSetLockManager#removeLock, and the code as bellow:
{code:java}
@Override
public void removeLock(LockLevel level, String... resources) {
  String lockName = generateLockName(level, resources);
  try (AutoCloseDataSetLock lock = writeLock(level, resources)) {
    // Here, this lock is redundant.
    lock.lock();
    lockMap.removeLock(lockName);
  }
} {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to