From d167ef48502c73d8d5ffed632acfabafafedf6c6 Mon Sep 17 00:00:00 2001 From: liever18 <47295183+liever18@users.noreply.github.com> Date: Wed, 5 Jan 2022 23:42:58 +0800 Subject: [PATCH] HDFS-16408. Ensure LeaseRecheckIntervalMs is greater than zero (#3856) (cherry picked from commit e1d0aa9ee5851d3cdc3b125daebe5cc9305ad6f0) --- .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index fbe32c03952..8daa474bab2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -959,6 +959,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, this.leaseRecheckIntervalMs = conf.getLong( DFS_NAMENODE_LEASE_RECHECK_INTERVAL_MS_KEY, DFS_NAMENODE_LEASE_RECHECK_INTERVAL_MS_DEFAULT); + Preconditions.checkArgument( + leaseRecheckIntervalMs > 0, + DFSConfigKeys.DFS_NAMENODE_LEASE_RECHECK_INTERVAL_MS_KEY + + " must be greater than zero"); this.maxLockHoldToReleaseLeaseMs = conf.getLong( DFS_NAMENODE_MAX_LOCK_HOLD_TO_RELEASE_LEASE_MS_KEY, DFS_NAMENODE_MAX_LOCK_HOLD_TO_RELEASE_LEASE_MS_DEFAULT);