summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-02-05 15:18:44 +0100
committerGitHub <noreply@github.com>2018-02-05 15:18:44 +0100
commit1e5d0f436dbb089ddc666938fe7f82b5374cad76 (patch)
tree0c118d52e38df73ef68f1797869a1895478ecb8f
parent9ed2f7678b9fe349ed84a263bb2e21f0b4aa3092 (diff)
Revert "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, 7 insertions, 13 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 63fa313fe72..a40f5d55317 100644
--- a/container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java
+++ b/container-search/src/main/java/com/yahoo/fs4/GetDocSumsPacket.java
@@ -102,9 +102,10 @@ public class GetDocSumsPacket extends Packet {
buffer.putInt((int)features);
buffer.putInt(0); //Unused, was docstamp
long timeLeft = query.getTimeLeft();
- buffer.putInt((int)timeLeft);
+ final int minTimeout = 50;
+ buffer.putInt(Math.max(minTimeout, (int)timeLeft));
if (log.isLoggable(LogLevel.DEBUG)) {
- log.log(LogLevel.DEBUG, "Timeout from query(" + query.getTimeout() + "), sent to backend: " + timeLeft);
+ log.log(LogLevel.DEBUG, "Timeout from query(" + query.getTimeout() + "), sent to backend: " + Math.max(minTimeout, 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 ff2ca443cbf..1513cf2213c 100644
--- a/container-search/src/main/java/com/yahoo/fs4/QueryPacket.java
+++ b/container-search/src/main/java/com/yahoo/fs4/QueryPacket.java
@@ -123,7 +123,8 @@ public class QueryPacket extends Packet {
ignoreableOffset = buffer.position() - relativeZero;
IntegerCompressor.putCompressedPositiveNumber(getOffset(), buffer);
IntegerCompressor.putCompressedPositiveNumber(getHits(), buffer);
- buffer.putInt((int)query.getTimeLeft());
+ // store the cutoff time in the tag object, and then do a similar Math.max there
+ buffer.putInt(Math.max(50, (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 3b84f83fafa..635659204e8 100755
--- a/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
+++ b/vespaclient-core/src/main/java/com/yahoo/feedhandler/FeedResponse.java
@@ -172,22 +172,14 @@ 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 (isTransientError(error)) {
+ } else if (error >= ErrorCode.TRANSIENT_ERROR && (error < ErrorCode.FATAL_ERROR)) {
return com.yahoo.container.protect.Error.INTERNAL_SERVER_ERROR;
- } if (isFatalError(error)) {
+ } if (error >= ErrorCode.FATAL_ERROR && (error < ErrorCode.ERROR_LIMIT)) {
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();
}