File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
util/src/main/java/io/kubernetes/client/informer/cache Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 9
9
import org .slf4j .Logger ;
10
10
import org .slf4j .LoggerFactory ;
11
11
12
+ import java .io .IOException ;
12
13
import java .lang .reflect .Method ;
13
14
import java .net .ConnectException ;
14
15
import java .util .ArrayList ;
@@ -100,6 +101,10 @@ public void run() {
100
101
}
101
102
log .error ("ReflectRunnable#watch failed as {} unexpected" , t .getMessage (), t );
102
103
return ;
104
+ } finally {
105
+ if (watch != null ) {
106
+ watch .close ();
107
+ }
103
108
}
104
109
}
105
110
} catch (Throwable t ) {
@@ -124,7 +129,7 @@ public String getLastSyncResourceVersion() {
124
129
return lastSyncResourceVersion ;
125
130
}
126
131
127
- private void watchHandler (io .kubernetes .client .util .Watch <T > watch ) {
132
+ private void watchHandler (io .kubernetes .client .util .Watch <T > watch ) throws IOException {
128
133
while (watch .hasNext ()) {
129
134
io .kubernetes .client .util .Watch .Response <T > item = watch .next ();
130
135
You can’t perform that action at this time.
0 commit comments