Skip to content

Commit 7d43ee7

Browse files
committed
Typo
1 parent 4847759 commit 7d43ee7

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/main/java/oracle/kubernetes/operator/Watcher.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void setListener(WatchListener<T> listener) {
8787
*/
8888
void start(ThreadFactory factory) {
8989
thread = factory.newThread(this::doWatch);
90-
thread.run();
90+
thread.start();
9191
}
9292

9393
private void doWatch() {
@@ -136,7 +136,8 @@ private void watchForEvents(ApiClient client) {
136136
else
137137
handleRegularUpdate(item);
138138
}
139-
} catch (RuntimeException | ApiException | IOException ignored) {
139+
} catch (Throwable ex) {
140+
LOGGER.warning(MessageKeys.EXCEPTION, ex);
140141
}
141142
}
142143

src/main/java/oracle/kubernetes/operator/rest/RestServer.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,15 @@ private HttpServer createHttpsServer(Container container, SSLContext ssl, String
230230
ThreadFactory x = t.getThreadFactory();
231231
ThreadFactory tf = x != null ? x : Executors.defaultThreadFactory();
232232
t.setThreadFactory((r) -> {
233-
return tf.newThread(() -> {
233+
Thread n = tf.newThread(() -> {
234234
ContainerResolver.getDefault().enterContainer(container);
235235
r.run();
236+
236237
});
238+
if (!n.isDaemon()) {
239+
n.setDaemon(true);
240+
}
241+
return n;
237242
});
238243

239244
t = transport.getKernelThreadPoolConfig();
@@ -245,10 +250,14 @@ private HttpServer createHttpsServer(Container container, SSLContext ssl, String
245250
x = t.getThreadFactory();
246251
ThreadFactory tf2 = x != null ? x : Executors.defaultThreadFactory();
247252
t.setThreadFactory((r) -> {
248-
return tf2.newThread(() -> {
253+
Thread n = tf2.newThread(() -> {
249254
ContainerResolver.getDefault().enterContainer(container);
250255
r.run();
251256
});
257+
if (!n.isDaemon()) {
258+
n.setDaemon(true);
259+
}
260+
return n;
252261
});
253262
transport.setSelectorRunnersCount(CORE_POOL_SIZE);
254263
}

0 commit comments

Comments
 (0)