diff options
author | jonmv <venstad@gmail.com> | 2024-01-05 11:55:37 +0100 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2024-01-05 11:55:37 +0100 |
commit | ad5add0e027cfbc384055c540e0b8f96c6f37543 (patch) | |
tree | 323a8f3d2cce322622690b821d1d0b5b7cd66f70 /client/go | |
parent | bc2d94646008dfb8dde78ff0e94e19a842dfdc4a (diff) |
Do not retry server errors (500, 502, 504) when feeding
Diffstat (limited to 'client/go')
-rw-r--r-- | client/go/internal/vespa/document/dispatcher.go | 2 | ||||
-rw-r--r-- | client/go/internal/vespa/document/dispatcher_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/client/go/internal/vespa/document/dispatcher.go b/client/go/internal/vespa/document/dispatcher.go index 786e7c332a4..803b124c825 100644 --- a/client/go/internal/vespa/document/dispatcher.go +++ b/client/go/internal/vespa/document/dispatcher.go @@ -116,7 +116,7 @@ func (d *Dispatcher) shouldRetry(op documentOp, result Result) bool { } else if result.HTTPStatus == 429 { d.throttler.Throttled(d.inflightCount.Load()) return true - } else if result.Err != nil || result.HTTPStatus == 500 || result.HTTPStatus == 502 || result.HTTPStatus == 503 || result.HTTPStatus == 504 { + } else if result.Err != nil || result.HTTPStatus == 503 { d.circuitBreaker.Failure() if op.attempts < maxAttempts { return true diff --git a/client/go/internal/vespa/document/dispatcher_test.go b/client/go/internal/vespa/document/dispatcher_test.go index 4c52bd759d9..d85432474da 100644 --- a/client/go/internal/vespa/document/dispatcher_test.go +++ b/client/go/internal/vespa/document/dispatcher_test.go @@ -38,7 +38,7 @@ func (f *mockFeeder) Send(doc Document) Result { failRequest := (f.failAfterNDocs > 0 && len(f.documents) >= f.failAfterNDocs) || (f.failCount > 0 && f.sendCount <= f.failCount) if failRequest { - result.HTTPStatus = 500 + result.HTTPStatus = 503 result.Status = StatusVespaFailure } else { f.documents = append(f.documents, doc) |