nfsantos commented on code in PR #2343:
URL: https://github.com/apache/jackrabbit-oak/pull/2343#discussion_r2161818242


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java:
##########
@@ -532,14 +494,11 @@ public void afterBulk(long executionId, BulkRequest 
request, List<OperationConte
 
         @Override
         public void afterBulk(long executionId, BulkRequest request, 
List<OperationContext> contexts, Throwable failure) {
+            // Called in case of a connection failure or other error that 
prevented the full bulk request from being executed
             try {
-                LOG.error("ElasticIndex Update Bulk Failure : Bulk with id {} 
threw an error", executionId, failure);
-                globalSuppressedErrorCauses.add(ErrorCause.of(ec -> {
-                    StringWriter sw = new StringWriter();
-                    PrintWriter pw = new PrintWriter(sw);
-                    failure.printStackTrace(pw);
-                    return 
ec.reason(failure.getMessage()).stackTrace(sw.toString());
-                }));
+                LOG.warn("ElasticIndex Update Bulk Failure : Bulk with id {} 
threw an error", executionId, failure);

Review Comment:
   In this case, it is a connection failure to Elastic. This can happen under 
"normal" conditions, when Elastic is scaling up/down, there is a failure on 
Elastic or there is some connection problem. All these are normal conditions 
that we handle. The exception is saved internally in the 
ElasticBulkProcessorHandler and then propagated to client code, which may retry 
or decide to give up. I think since at this point we are not sure there is a 
fatal error, we should just log as warn and let the higher levels decide what 
to do: retry or give up and log an ERROR. Once again, I don't have strong 
feelings about this, so I can change it to ERROR.



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to