diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-08-10 10:13:38 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-08-10 10:13:38 +0200 |
commit | 70079d9b19badf0014725bb9042ae72c037a8a72 (patch) | |
tree | 37a230e3da283a7e6404bbc549f35508bfc87ba4 | |
parent | 4b5ca059eda0ab6f3c1fa0c718980d7a6e978288 (diff) |
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); |