summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java
index d27ebc551d9..301b81f040c 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java
@@ -133,7 +133,7 @@ class ClientFeederV3 {
* We try 10 for now. This should only kick in with very massive feeding to few gateway nodes.
*/
if (feederSettings.denyIfBusy && threadsAvailableForFeeding.get() < -10) {
- return new ErrorHttpResponse(429, "Gateway overloaded");
+ return new ErrorHttpResponse(getOverloadReturnCode(request), "Gateway overloaded");
}
InputStream inputStream = StreamReaderV3.unzipStreamIfNeeded(request);
@@ -166,6 +166,13 @@ class ClientFeederV3 {
}
}
+ private int getOverloadReturnCode(HttpRequest request) {
+ if (request.getHeader(Headers.SILENTUPGRADE) != null ) {
+ return 299;
+ }
+ return 429;
+ }
+
private Optional<DocumentOperationMessageV3> pullMessageFromRequest(
FeederSettings settings, InputStream requestInputStream, BlockingQueue<OperationStatus> repliesFromOldMessages) {
while (true) {