From 1aec0c8355f3fc89851e0117ef66cd8eb9006837 Mon Sep 17 00:00:00 2001 From: andystenhe Date: Tue, 23 May 2023 22:31:12 +0800 Subject: [PATCH] fix issues 1983 (#1984) Co-authored-by: hexiufeng --- .../KubernetesApplicationGateway.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java index 55aaa0ae46..ce938d22b4 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/kubernetes/KubernetesApplicationGateway.java @@ -38,6 +38,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.concurrent.ExecutionException; + +import cn.hutool.core.util.StrUtil; /** * KubernetesApplicationGateway @@ -84,7 +87,19 @@ public GatewayResult submitJar() { while (jobStatusMessages.size() == 0 && counts > 0) { Thread.sleep(1000); counts--; - jobStatusMessages = clusterClient.listJobs().get(); + try { + jobStatusMessages = clusterClient.listJobs().get(); + } catch (ExecutionException e) { + if (StrUtil.contains(e.getMessage(), "Number of retries has been exhausted.")) { + // refresh the job manager ip address + clusterClient.close(); + clusterClient = clusterClientProvider.getClusterClient(); + } else { + LogUtil.getError(e); + throw e; + } + } + if (jobStatusMessages.size() > 0) { break; }