From ffbe8356fb80be6c7995915db7df528edf5fda1e Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Thu, 16 Dec 2021 08:08:03 +0000 Subject: make select timeout tunable with system property --- jrt/src/com/yahoo/jrt/TransportThread.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'jrt/src') diff --git a/jrt/src/com/yahoo/jrt/TransportThread.java b/jrt/src/com/yahoo/jrt/TransportThread.java index a3f1773c814..fdb5fca891c 100644 --- a/jrt/src/com/yahoo/jrt/TransportThread.java +++ b/jrt/src/com/yahoo/jrt/TransportThread.java @@ -20,6 +20,13 @@ public class TransportThread { private static final int CLOSING = 2; private static final int CLOSED = 3; + private static final int SELECT_TIMEOUT_MS = getSelectTimeoutMs(); + + private static int getSelectTimeoutMs() { + // can override with a System property + return Integer.getInteger("vespa.jrt.select.timeout", 100); + } + private class Run implements Runnable { public void run() { try { @@ -311,7 +318,7 @@ public class TransportThread { // perform I/O selection try { - selector.select(100); + selector.select(SELECT_TIMEOUT_MS); } catch (IOException e) { log.log(Level.WARNING, "error during select", e); } -- cgit v1.2.3