HADOOP-18905. Negative timeout in ZKFailovercontroller due to overflow. (#6092). Contributed by ConfX.

Reviewed-by: Inigo Goiri <inigoiri@apache.org>
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
ConfX 2023-10-29 16:00:28 +08:00 committed by GitHub
parent b9c9c42b29
commit 7c6af6a5f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();