diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-08-10 10:39:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-10 10:39:05 +0200 |
commit | 6ba33d417eb1ca01cd7a67aaf0c60eb2d9b12013 (patch) | |
tree | a2d398937ac27d9461adf488ea9caf1880a83138 | |
parent | b9848e0e4fddb7fa5725c7abc47a14cbee2c079e (diff) | |
parent | 70079d9b19badf0014725bb9042ae72c037a8a72 (diff) |
Merge pull request #18698 from vespa-engine/jonmv/avoid-filling-inflight-tracking-map-on-shutdown
Return completed futures without marking as inflight
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java index 485e6f03908..667f3489cf7 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java @@ -239,13 +239,13 @@ class HttpRequestStrategy implements RequestStrategy { @Override public CompletableFuture<HttpResponse> enqueue(DocumentId documentId, HttpRequest request) { RetriableFuture<HttpResponse> result = new RetriableFuture<>(); // Carries the aggregate result of the operation, including retries. - CompletableFuture<HttpResponse> vessel = new CompletableFuture<>(); // Holds the computation of a single dispatch to the HTTP client. - RetriableFuture<HttpResponse> previous = inflightById.put(documentId, result); if (destroyed.get()) { result.complete(); return result; } + CompletableFuture<HttpResponse> vessel = new CompletableFuture<>(); // Holds the computation of a single dispatch to the HTTP client. + RetriableFuture<HttpResponse> previous = inflightById.put(documentId, result); if (previous == null) { acquireSlot(); offer(request, vessel); |