This is an automated email from the ASF dual-hosted git repository.

ddanielr pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/2.1 by this push:
     new f98c87cb57 Improves thrift error logging level (#4236)
f98c87cb57 is described below

commit f98c87cb5798c781364a7773d17b1325a73b9f5d
Author: Daniel Roberts <ddani...@gmail.com>
AuthorDate: Tue Feb 6 19:03:33 2024 -0500

    Improves thrift error logging level (#4236)
    
    Drops thrift connection errors down to a `debug` level
    On every 5th error message, the logger will elevate that message to
    `warn` instead of `debug`.
---
 .../apache/accumulo/server/compaction/RetryableThriftCall.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java
 
b/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java
index 6cfba2ee23..020e436af6 100644
--- 
a/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java
+++ 
b/server/base/src/main/java/org/apache/accumulo/server/compaction/RetryableThriftCall.java
@@ -95,11 +95,18 @@ public class RetryableThriftCall<T> {
    */
   public T run() throws RetriesExceededException {
     T result = null;
+    var errorsSeen = 0;
     do {
       try {
         result = function.execute();
       } catch (TException e) {
-        LOG.error("Error in Thrift function, retrying ...", e);
+        errorsSeen++;
+        // Log higher levels of errors on every 5th error
+        if (errorsSeen >= 5 && errorsSeen % 5 == 0) {
+          LOG.warn("Error in Thrift function, retrying ...", e);
+        } else {
+          LOG.debug("Error in Thrift function, retrying ...", e);
+        }
       }
       if (result == null) {
         if (this.retry.canRetry()) {

Reply via email to