From 7c6af6a5f626d18d68b656d085cc23e4c1f7a1ef Mon Sep 17 00:00:00 2001 From: ConfX <114765570+teamconfx@users.noreply.github.com> Date: Sun, 29 Oct 2023 16:00:28 +0800 Subject: [PATCH] HADOOP-18905. Negative timeout in ZKFailovercontroller due to overflow. (#6092). Contributed by ConfX. Reviewed-by: Inigo Goiri Signed-off-by: Ayush Saxena --- .../src/main/java/org/apache/hadoop/ha/ZKFailoverController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java index 487d7b9409..91f720a49e 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java @@ -660,6 +660,7 @@ public Void run() throws Exception { private void doGracefulFailover() throws ServiceFailedException, IOException, InterruptedException { int timeout = FailoverController.getGracefulFenceTimeout(conf) * 2; + Preconditions.checkArgument(timeout >= 0, "timeout should be non-negative."); // Phase 1: pre-flight checks checkEligibleForFailover();