Skip to content

Commit

Permalink
schedule reconnect in case of HTTP_GONE
Browse files Browse the repository at this point in the history
Reset resource version to null and schedule reconnect in case of
HTTP_GHONE
  • Loading branch information
honnix committed Oct 7, 2019
1 parent 580d700 commit 45f72ff
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,13 @@ 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) {
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.info("The resource version {} no longer exists. Scheduling a reconnect.", resourceVersion.get());
resourceVersion.set(null);
scheduleReconnect();
} else {
logger.error("Error received: {}", status.toString());
}

logger.error("Error received: {}", status.toString());
} else {
logger.error("Unknown message received: {}", message);
}
Expand Down

0 comments on commit 45f72ff

Please sign in to comment.