You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/05/20 00:56:55 UTC

[GitHub] [hadoop] jojochuang commented on a diff in pull request #4332: HDFS-16583. DatanodeAdminDefaultMonitor can get stuck in an infinite loop holding the write lock

jojochuang commented on code in PR #4332:
URL: https://github.com/apache/hadoop/pull/4332#discussion_r877643028


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminManager.java:
##########
@@ -255,6 +255,15 @@ public void startMaintenance(DatanodeDescriptor node,
    */
   @VisibleForTesting
   public void stopMaintenance(DatanodeDescriptor node) {
+    boolean shouldStopTracking = node.isMaintenance();
+    stopMaintenanceInternal(node);
+    if (shouldStopTracking) {
+      // Remove from tracking in DatanodeAdminManager
+      monitor.stopTrackingNode(node);
+    }
+  }
+
+  protected void stopMaintenanceInternal(DatanodeDescriptor node) {

Review Comment:
   would be great to add comments or make the method name more self-explanatory.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org