summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <jonbratseth@yahoo.com>2018-02-05 14:40:38 +0100
committerGitHub <noreply@github.com>2018-02-05 14:40:38 +0100
commit991c15e111f6ff9ab7a5b08193c8e62371916eca (patch)
tree9f9c0a5d56998e42ca0d2a070f58a22139f80ff2
parentef25cd5e64c5d8a4ce42423f914da381ca3d04b5 (diff)
parent2b1c0c4b415bf64a153083746ef31da06dcf9ccf (diff)
Merge pull request #4916 from vespa-engine/balder/again-when-time-is-up-it-is-up
Balder/again when time is up it is up
-rw-r--r--container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java5
-rw-r--r--container-search/src/main/java/com/yahoo/fs4/QueryPacket.java3
-rwxr-xr-xvespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java12
3 files changed, 13 insertions, 7 deletions
diff --git a/container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java b/container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java
index a40f5d55317..63fa313fe72 100644
--- a/container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java
+++ b/container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java
@@ -102,10 +102,9 @@ public class GetDocSumsPacket extends Packet {
buffer.putInt((int)features);
buffer.putInt(0); //Unused, was docstamp
long timeLeft = query.getTimeLeft();
- final int minTimeout = 50;
- buffer.putInt(Math.max(minTimeout, (int)timeLeft));
+ buffer.putInt((int)timeLeft);
if (log.isLoggable(LogLevel.DEBUG)) {
- log.log(LogLevel.DEBUG, "Timeout from query(" + query.getTimeout() + "), sent to backend: " + Math.max(minTimeout, timeLeft));
+ log.log(LogLevel.DEBUG, "Timeout from query(" + query.getTimeout() + "), sent to backend: " + timeLeft);
}
if (queryPacketData != null)
diff --git a/container-search/src/main/java/com/yahoo/fs4/QueryPacket.java b/container-search/src/main/java/com/yahoo/fs4/QueryPacket.java
index 1513cf2213c..ff2ca443cbf 100644
--- a/container-search/src/main/java/com/yahoo/fs4/QueryPacket.java
+++ b/container-search/src/main/java/com/yahoo/fs4/QueryPacket.java
@@ -123,8 +123,7 @@ public class QueryPacket extends Packet {
ignoreableOffset = buffer.position() - relativeZero;
IntegerCompressor.putCompressedPositiveNumber(getOffset(), buffer);
IntegerCompressor.putCompressedPositiveNumber(getHits(), buffer);
- // store the cutoff time in the tag object, and then do a similar Math.max there
- buffer.putInt(Math.max(50, (int)query.getTimeLeft()));
+ buffer.putInt((int)query.getTimeLeft());
ignoreableSize = buffer.position() - relativeZero - ignoreableOffset;
buffer.putInt(getFlagInt());
int startOfFieldToSave = buffer.position();
diff --git a/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java b/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
index 635659204e8..3b84f83fafa 100755
--- a/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
+++ b/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
@@ -172,14 +172,22 @@ public final class FeedResponse extends HttpResponse implements SharedSender.Res
// Like busy, no space etc.
if (error == DocumentProtocol.ERROR_NO_SPACE) {
return com.yahoo.container.protect.Error.INSUFFICIENT_STORAGE;
- } else if (error >= ErrorCode.TRANSIENT_ERROR && (error < ErrorCode.FATAL_ERROR)) {
+ } else if (isTransientError(error)) {
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
- } if (error >= ErrorCode.FATAL_ERROR && (error < ErrorCode.ERROR_LIMIT)) {
+ } if (isFatalError(error)) {
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
}
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
}
+ private static boolean isFatalError(int error) {
+ return (error >= ErrorCode.FATAL_ERROR) && (error < ErrorCode.ERROR_LIMIT);
+ }
+
+ private static boolean isTransientError(int error) {
+ return (error >= ErrorCode.TRANSIENT_ERROR) && (error < ErrorCode.FATAL_ERROR);
+ }
+
public boolean isSuccess() {
return errors.isEmpty();
}