diff options
author | Jon Bratseth <bratseth@oath.com> | 2019-02-12 15:19:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 15:19:59 +0100 |
commit | 9b7af46ffcddc4ef24d0c7677ef45799e8ef9e8d (patch) | |
tree | 8ec341cb7c27a66d3496cb1c63f4d49a9b81afea | |
parent | 3bb08e98cf8e0d9a37bb11dbedbe5741355d72d0 (diff) | |
parent | 1beb1ce6dc7c0cc1512fead74977c1bda9ab03b6 (diff) |
Merge pull request #8477 from vespa-engine/ollivir/search-invoker-resource-leak
Fix search invoker resource leak
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/InterleavedSearchInvoker.java | 7 |
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()) { |