From 1474a930b38858bc814e14a11175b1787981bcfd Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Tue, 27 Apr 2021 10:08:44 +0200 Subject: Change the way we switch connection when the current one is not working Consider only healthy sources (if there are any) when switching to a new one fue to failures. Also log when connecting to a source --- .../java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java | 2 +- .../test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'filedistribution') 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 9f872ac7042..05fbd457a0d 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java +++ b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java @@ -127,7 +127,7 @@ public class FileReferenceDownloader { return true; } else { log.log(logLevel, "File reference '" + fileReference + "' not found at " + connection.getAddress()); - connectionPool.setNewCurrentConnection(); + connectionPool.switchConnection(); return false; } } else { diff --git a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java b/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java index a68b6527aad..1344b7afbb3 100644 --- a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java +++ b/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java @@ -341,7 +341,7 @@ public class FileDownloaderTest { } @Override - public Connection setNewCurrentConnection() { + public Connection switchConnection() { return this; } -- cgit v1.2.3