nit0906 commented on code in PR #639:
URL: https://github.com/apache/jackrabbit-oak/pull/639#discussion_r930100101
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -323,7 +334,14 @@ public void onSuccess(SearchResponse<ObjectNode>
searchResponse) {
public void onFailure(Throwable t) {
metricHandler.measureFailedQuery(indexNode.getDefinition().getIndexPath(),
System.currentTimeMillis() - searchStartTime);
- LOG.error("Error retrieving data from Elastic: closing scanner,
notifying listeners", t);
+ // Check in case errorRef is already set - this seems unlikely
since we close the scanner once we hit failure.
+ // But still, in case this do happen, we will log a warn.
+ Throwable error = errorRef.getAndSet(t);
+ if (error != null) {
+ LOG.warn("Error reference for async iterator was previously
set to {}. It has now been reset to new error {}", error.getMessage(),
t.getMessage());
+ }
+
+ LOG.error("Error retrieving data from Elastic for query [{}] :
closing scanner, notifying listeners", indexPlan.getFilter().toString(), t);
Review Comment:
done. Added the ES query as well
--
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]