Bugfixes
This commit is contained in:
parent
3a544d4297
commit
1a73a5a33f
@ -19,13 +19,12 @@ public abstract class LiveResourceSupport<I extends Resource<I>, T extends LiveR
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
if (this.isAccessible()) {
|
||||
try {
|
||||
this.close();
|
||||
} catch (Throwable ignored) {
|
||||
} finally {
|
||||
var ise = new IllegalStateException("Resource not released");
|
||||
ise.setStackTrace(new StackTraceElement[0]);
|
||||
logger.error("Resource not released: {}", this, attachTrace(ise));
|
||||
try {
|
||||
this.close();
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
super.finalize();
|
||||
|
@ -24,7 +24,7 @@ public class SimpleUnsortedUnscoredLuceneMultiSearcher implements LuceneMultiSea
|
||||
LocalQueryParams queryParams,
|
||||
String keyFieldName,
|
||||
LLSearchTransformer transformer) {
|
||||
var indexSearchersResource = Mono
|
||||
var indexSearchersSendResource = Mono
|
||||
.fromRunnable(() -> {
|
||||
LLUtils.ensureBlocking();
|
||||
if (queryParams.isSorted() && queryParams.limit() > 0) {
|
||||
@ -36,11 +36,12 @@ public class SimpleUnsortedUnscoredLuceneMultiSearcher implements LuceneMultiSea
|
||||
+ " by SimpleUnsortedUnscoredLuceneMultiSearcher");
|
||||
}
|
||||
})
|
||||
.then(indexSearchersMono.map(Send::receive));
|
||||
.then(indexSearchersMono);
|
||||
var localQueryParams = getLocalQueryParams(queryParams);
|
||||
|
||||
return LLUtils.usingResource(indexSearchersResource,
|
||||
indexSearchers -> Flux.fromIterable(indexSearchers.shards())
|
||||
return LLUtils.usingSendResource(indexSearchersSendResource,
|
||||
indexSearchers -> Flux
|
||||
.fromIterable(indexSearchers.shards())
|
||||
.flatMap(searcher -> {
|
||||
var llSearcher = Mono.fromCallable(() -> new LLIndexSearcher(searcher, d -> {}).send());
|
||||
return localSearcher.collect(llSearcher, localQueryParams, keyFieldName, transformer);
|
||||
@ -69,6 +70,7 @@ public class SimpleUnsortedUnscoredLuceneMultiSearcher implements LuceneMultiSea
|
||||
for (LuceneSearchResult luceneSearchResult : resultsToDrop) {
|
||||
luceneSearchResult.close();
|
||||
}
|
||||
indexSearchers.close();
|
||||
}).send();
|
||||
}),
|
||||
false
|
||||
|
Loading…
Reference in New Issue
Block a user