nit0906 commented on code in PR #639:
URL: https://github.com/apache/jackrabbit-oak/pull/639#discussion_r929779337


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -111,6 +110,25 @@ public boolean hasNext() {
                 throw new IllegalStateException("Error reading next result 
from Elastic", e);
             }
         }
+
+        // Check if there are any exception traces filled from onFailure 
Callback in the errorQueue
+        // Any exception (such as ParseException) during the prefetch (init 
scanner) via the async call to ES would be available here
+        // when the cursor is actually being traversed.
+        // This is being done so that we can log the caller stack trace in 
case of any exception from ES and not just the trace of the async query thread.
+        if (!errorQueue.isEmpty()) {
+            Exception e = new Exception();
+            e.setStackTrace(Thread.currentThread().getStackTrace());
+            String exceptionMsg = null;
+            try {
+                exceptionMsg = errorQueue.take().getMessage();
+            } catch (InterruptedException interruptedException) {
+               LOG.debug("Error while trying to read ES exception from error 
queue");
+            }

Review Comment:
   I can log that back again. I was just not finding it much useful. Apart from 
the exception message from ES - the rest of the trace is just mostly the ES 
async call handling. 
   
   But I think it wouldn't be any harm to log the original stack trace too. I 
will do that.



-- 
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]

Reply via email to