joseluisll commented on code in PR #8638:
URL: https://github.com/apache/hadoop/pull/8638#discussion_r3671158445


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java:
##########
@@ -722,8 +722,17 @@ private static BlockTokenSecretManager 
createBlockTokenSecretManager(
         DFSConfigKeys.DFS_BLOCK_ACCESS_KEY_UPDATE_INTERVAL_KEY, 
         DFSConfigKeys.DFS_BLOCK_ACCESS_KEY_UPDATE_INTERVAL_DEFAULT);
     final long lifetimeMin = conf.getLong(
-        DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_LIFETIME_KEY, 
+        DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_LIFETIME_KEY,
         DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_LIFETIME_DEFAULT);
+    if (lifetimeMin <= 0) {
+      throw new HadoopIllegalArgumentException(
+          DFSConfigKeys.DFS_BLOCK_ACCESS_TOKEN_LIFETIME_KEY + " = "
+              + lifetimeMin + " is invalid. It must be a positive number of"
+              + " minutes. A non-positive lifetime makes every block access"
+              + " token expire at the instant it is created, so DataNodes"
+              + " reject all of them and no write pipeline can be"
+              + " established.");
+    }

Review Comment:
   Implemented



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to