From be83797c3572c73fb9be04023828f96a9afceeca Mon Sep 17 00:00:00 2001 From: Hongxin Liang Date: Tue, 5 Nov 2019 08:55:02 +0100 Subject: [PATCH] Revert "schedule reconnect in case of HTTP_GONE" This reverts commit 45f72ff404815445dcf1574cbd97301e2c7548f9. --- .../dsl/internal/WatchConnectionManager.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java index afacb0c40b6..812ae0cae43 100644 --- a/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java +++ b/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/WatchConnectionManager.java @@ -255,13 +255,17 @@ public void onMessage(WebSocket webSocket, String message) { } else if (object instanceof Status) { Status status = (Status) object; + // The resource version no longer exists - this has to be handled by the caller. if (status.getCode() == HTTP_GONE) { - logger.info("The resource version {} no longer exists. Scheduling a reconnect.", resourceVersion.get()); - resourceVersion.set(null); - scheduleReconnect(); - } else { - logger.error("Error received: {}", status.toString()); + webSocketRef.set(null); // lose the ref: closing in close() would only generate a Broken pipe + // exception + // shut down executor, etc. + closeEvent(new KubernetesClientException(status)); + close(); + return; } + + logger.error("Error received: {}", status.toString()); } else { logger.error("Unknown message received: {}", message); }