Skip to content

Commit c6cebf7

Browse files
committed
sort list-watcher exception catch flow
1 parent 0e04222 commit c6cebf7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

util/src/main/java/io/kubernetes/client/informer/cache/ReflectorRunnable.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ public void run() {
132132
watch = newWatch;
133133
}
134134
watchHandler(newWatch);
135+
} catch (WatchExpiredException e) {
136+
// Watch calls were failed due to expired resource-version. Returning
137+
// to unwind the list-watch loops so that we can respawn a new round
138+
// of list-watching.
139+
log.info("{}#Watch expired, will re-list-watch soon", this.apiTypeClass);
140+
return;
135141
} catch (Throwable t) {
136142
if (isConnectException(t)) {
137143
// If this is "connection refused" error, it means that most likely
@@ -163,8 +169,6 @@ public void run() {
163169
closeWatch();
164170
}
165171
}
166-
} catch (WatchExpiredException e) {
167-
return;
168172
} catch (ApiException e) {
169173
if (e.getCode() == HttpURLConnection.HTTP_GONE) {
170174
log.info(

0 commit comments

Comments
 (0)