From 6bfe0951defb2a6949fb8ca3ae9f0ee7a3655204 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Wed, 22 Jun 2022 12:13:49 +0200 Subject: Make sure to return response when request times out Return with new error code 2. Clients only check for error code 0, so a new error code is handled implicitly also by old clients --- .../com/yahoo/vespa/filedistribution/FileReferenceDownloader.java | 5 +++-- 1 file changed, 3 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 03448b5fa4a..0267feb9ffc 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java +++ b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java @@ -112,11 +112,12 @@ public class FileReferenceDownloader { FileReference fileReference = fileReferenceDownload.fileReference(); if (validateResponse(request)) { log.log(Level.FINE, () -> "Request callback, OK. Req: " + request + "\nSpec: " + connection); - if (request.returnValues().get(0).asInt32() == 0) { + int errorCode = request.returnValues().get(0).asInt32(); + if (errorCode == 0) { log.log(Level.FINE, () -> "Found " + fileReference + " available at " + connection.getAddress()); return true; } else { - log.log(logLevel, fileReference + " not found at " + connection.getAddress()); + log.log(logLevel, fileReference + " not found or timed out (error code " + errorCode + ") at " + connection.getAddress()); return false; } } else { -- cgit v1.2.3