aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-06-25 14:15:58 +0200
committerJon Marius Venstad <venstad@gmail.com>2021-06-25 14:15:58 +0200
commit11a6745c68f2ae199bedd7aa06a13ea52e3dc8c1 (patch)
tree162f8e0cfbcef39b5a32eeddf8383945b0a0fe2f /vespa-feed-client
parentce27d7104be34f11e9d6966036b3bdfd7928dcc8 (diff)
Avoid race with NPE outcome eduring concurrent completion
Diffstat (limited to 'vespa-feed-client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/HttpRequestStrategy.java3
1 files changed, 2 insertions, 1 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 dc01f01b2e8..2480c9a7367 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
@@ -114,7 +114,8 @@ class HttpRequestStrategy implements RequestStrategy {
/** Complete now with the last result or error. */
void complete() {
completion.get().run();
- if (dependency.get() != null) dependency.getAndSet(null).complete();
+ RetriableFuture<T> toComplete = dependency.getAndSet(null);
+ if (toComplete != null) toComplete.complete();
}
/** Ensures the dependency is completed whenever this is. */