diff options
author | Arne H Juul <arnej@yahooinc.com> | 2021-12-16 08:08:03 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2021-12-16 14:03:52 +0000 |
commit | ffbe8356fb80be6c7995915db7df528edf5fda1e (patch) | |
tree | 805d71fc8df7e14c11e3401c80b53265a4a71030 /jrt | |
parent | 4e70126dd4df124b92865fe7eb3ea4491d6e09ee (diff) |
make select timeout tunable with system property
Diffstat (limited to 'jrt')
-rw-r--r-- | jrt/src/com/yahoo/jrt/TransportThread.java | 9 |
1 files changed, 8 insertions, 1 deletions
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); } |