Skip to content

Commit

Permalink
Revert "schedule reconnect in case of HTTP_GONE"
Browse files Browse the repository at this point in the history
This reverts commit 45f72ff.
  • Loading branch information
honnix committed Nov 5, 2019
1 parent 0b455df commit be83797
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

1 comment on commit be83797

@yujiantao
Copy link

@yujiantao yujiantao commented on be83797 Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@honnix Can you explain why "schedule reconnect in case of HTTP_GONE" was reverted? I think it is reasonable to schedule reconnect in case of HTTP_GONE, otherwise connection will fail here as resourceVersion is not null in the previous reconnection request.

Please sign in to comment.