aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2022-01-12 15:07:22 +0100
committerHarald Musum <musum@yahooinc.com>2022-01-12 15:07:22 +0100
commit93f2af5e853472d0deaabd20490f393df19cb6a2 (patch)
tree580e674d122031e29d7c8977ad2d05317bf6a8d5 /configserver
parent6fd8eb7f4eeae6bb50e2f7c249bbe10ad40b72dc (diff)
Use lower timeout
If we get a request for a file reference we don't have, try to download with 10 second timeout and reply with not found otherwise, otherwise a thread might be busy for a long time and we might end up with all threads being busy and no requests can be served
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java
index 81cd1dd9738..8e5eee2104c 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileServer.java
@@ -27,6 +27,7 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.time.Duration;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -217,7 +218,8 @@ public class FileServer {
return new FileDownloader(configServers.isEmpty()
? FileDownloader.emptyConnectionPool()
: createConnectionPool(configServers, supervisor),
- supervisor);
+ supervisor,
+ Duration.ofSeconds(10)); // set this low, to make sure we don't wait a for a long time in this thread
}
private static ConnectionPool createConnectionPool(List<String> configServers, Supervisor supervisor) {