nfsantos commented on code in PR #639:
URL: https://github.com/apache/jackrabbit-oak/pull/639#discussion_r929786276
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -71,11 +71,11 @@ public class ElasticResultRowAsyncIterator implements
Iterator<FulltextResultRow
private final Predicate<String> rowInclusionPredicate;
private final ElasticMetricHandler metricHandler;
private final LMSEstimator estimator;
-
private final ElasticQueryScanner elasticQueryScanner;
private final ElasticRequestHandler elasticRequestHandler;
private final ElasticResponseHandler elasticResponseHandler;
private final ElasticFacetProvider elasticFacetProvider;
+ private final BlockingQueue<Throwable> errorQueue = new
LinkedBlockingQueue<>();
Review Comment:
Ok, I see how `onFailure()` can potentially be called multiple times,
although it's not totally clear to me how that would happen. `onFailure()`
calls `close()`, which suggests that the intention is to stop any more
retrieval of results or of errors. And there is a semaphore to ensure that
there is just one request sent at a time. But the way that synchronisation is
done with the semaphore, it seems possible that we send another request even
after calling close. Then again, I'm not totally sure about the flow of this
code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]