Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schedule reconnect in case of HTTP_GONE #1800

Merged
merged 6 commits into from
Oct 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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