diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-03-22 22:08:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 22:08:36 +0100 |
commit | c187799d8a25f00851a2d566caf5358486090366 (patch) | |
tree | 275dc4bc634c91cc3750e79c9ab433cdb7697826 /configserver | |
parent | 9379e425712abe71fcd2f406c139baf25a017108 (diff) |
Revert "Do RPC call asynchronously and with higher timeout "
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java index be82d3950a5..36d76bbfc79 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDistributionImpl.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.config.server.filedistribution; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.config.FileReference; import com.yahoo.config.model.api.FileDistribution; +import com.yahoo.jrt.ErrorCode; import com.yahoo.jrt.Request; import com.yahoo.jrt.Spec; import com.yahoo.jrt.StringArray; @@ -44,16 +45,14 @@ public class FileDistributionImpl implements FileDistribution { // as downloading will then start synchronously when a service requests a file reference instead private void startDownloadingFileReferences(String hostName, int port, Set<FileReference> fileReferences) { Target target = supervisor.connect(new Spec(hostName, port)); - double timeout = 0.5; + double timeout = 0.1; Request request = new Request("filedistribution.setFileReferencesToDownload"); request.parameters().add(new StringArray(fileReferences.stream().map(FileReference::value).toArray(String[]::new))); log.log(LogLevel.DEBUG, "Executing " + request.methodName() + " against " + target.toString()); - target.invokeAsync(request, timeout, (req) -> { - if (req.isError()) { - log.log(LogLevel.DEBUG, req.methodName() + " failed: " + req.errorCode() + " (" + req.errorMessage() + ")"); - } - req.target().close(); - }); + target.invokeSync(request, timeout); + if (request.isError() && request.errorCode() != ErrorCode.CONNECTION) { + log.log(LogLevel.DEBUG, request.methodName() + " failed: " + request.errorCode() + " (" + request.errorMessage() + ")"); + } + target.close(); } - } |