Skip to content

Commit 2d7b94c

Browse files
Reduce WebSocket flush delay from 100ms to 1ms
Co-authored-by: brendandburns <[email protected]>
1 parent af6a4be commit 2d7b94c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ public void flush() throws IOException {
272272
int i = 0;
273273
while (WebSocketStreamHandler.this.socket.queueSize() > 0) {
274274
try {
275-
Thread.sleep(100);
275+
Thread.sleep(1);
276276
} catch (InterruptedException ex) {
277277
}
278278
// Wait a maximum of 10 seconds.
279-
if (i++ > 100) {
279+
if (i++ > 10000) {
280280
throw new IOException("Timed out waiting for web-socket to flush.");
281281
}
282282
}

0 commit comments

Comments
 (0)