summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-03-01 17:58:25 +0100
committerGitHub <noreply@github.com>2021-03-01 17:58:25 +0100
commit1bb924022164057e9215afce0cd8428c830acb62 (patch)
tree9c13945eb91d2842b9356d6989fa311b8519c009
parent616be2724603dfac17d45db8eccd52369988a7d9 (diff)
parentc841479866487e4fe56fe8d89281833b88ad5aaf (diff)
Merge pull request #16727 from vespa-engine/hmusum/increase-file-download-rtc-timeout-and-use-env-variable
Increase RPC timeout for getting files and use environment variable i…
-rw-r--r--filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java
index 7e14e94823b..e77e8530f03 100644
--- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java
+++ b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java
@@ -35,7 +35,6 @@ import java.util.stream.Collectors;
public class FileReferenceDownloader {
private final static Logger log = Logger.getLogger(FileReferenceDownloader.class.getName());
- private final static Duration rpcTimeout = Duration.ofSeconds(10);
private final ExecutorService downloadExecutor =
Executors.newFixedThreadPool(Math.max(8, Runtime.getRuntime().availableProcessors()),
@@ -47,6 +46,7 @@ public class FileReferenceDownloader {
private final DownloadStatuses downloadStatuses = new DownloadStatuses();
private final Duration downloadTimeout;
private final Duration sleepBetweenRetries;
+ private final Duration rpcTimeout;
FileReferenceDownloader(File downloadDirectory, File tmpDirectory, ConnectionPool connectionPool, Duration timeout, Duration sleepBetweenRetries) {
this.connectionPool = connectionPool;
@@ -54,6 +54,8 @@ public class FileReferenceDownloader {
this.sleepBetweenRetries = sleepBetweenRetries;
// Needed to receive RPC calls receiveFile* from server after asking for files
new FileReceiver(connectionPool.getSupervisor(), this, downloadDirectory, tmpDirectory);
+ String timeoutString = System.getenv("VESPA_CONFIGPROXY_FILEDOWNLOAD_RPC_TIMEOUT");
+ this.rpcTimeout = Duration.ofSeconds(timeoutString == null ? 30 : Integer.parseInt(timeoutString));
}
private void startDownload(FileReferenceDownload fileReferenceDownload) {
@@ -128,8 +130,8 @@ public class FileReferenceDownloader {
}
} else {
log.log(logLevel, () -> "Request failed. Req: " + request + "\nSpec: " + connection.getAddress() +
- ", error code: " + request.errorCode() + ", set error for spec, use another spec for next request" +
- ", retry count " + retryCount);
+ ", error code: " + request.errorCode() + ", will use another spec for next request" +
+ ", retry count " + retryCount + ", rpc timeout " + rpcTimeout.getSeconds());
connectionPool.setError(connection, request.errorCode());
return false;
}