summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlli Virtanen <olli.virtanen@oath.com>2019-02-12 15:08:01 +0100
committerOlli Virtanen <olli.virtanen@oath.com>2019-02-12 15:08:01 +0100
commit1beb1ce6dc7c0cc1512fead74977c1bda9ab03b6 (patch)
tree157e5f6589522f0e4fc374316ae5dc6eceb5665b
parentba4dffd8c1f3ec5586fc7bf8699ccbc6e70ba453 (diff)
Fix search invoker resource leak
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/InterleavedSearchInvoker.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/InterleavedSearchInvoker.java b/container-search/src/main/java/com/yahoo/search/dispatch/InterleavedSearchInvoker.java
index fd861ab7c02..67be6a5486c 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/InterleavedSearchInvoker.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/InterleavedSearchInvoker.java
@@ -105,8 +105,8 @@ public class InterleavedSearchInvoker extends SearchInvoker implements ResponseM
log.fine(() -> "Search timed out with " + askedNodes + " requests made, " + answeredNodes + " responses received");
break;
} else {
- invokers.remove(invoker);
mergeResult(invoker.getSearchResult(cacheKey, execution));
+ ejectInvoker(invoker);
}
nextTimeout = nextTimeout();
}
@@ -241,6 +241,11 @@ public class InterleavedSearchInvoker extends SearchInvoker implements ResponseM
}
}
+ private void ejectInvoker(SearchInvoker invoker) {
+ invokers.remove(invoker);
+ invoker.release();
+ }
+
@Override
protected void release() {
if (!invokers.isEmpty()) {