You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2022/10/26 17:13:13 UTC

[accumulo] branch 2.1 updated: Log the client address when FrameBuffer read or write methods return false (#3047)

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

dlmarion 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 2ea2f8eb57 Log the client address when FrameBuffer read or write methods return false (#3047)
2ea2f8eb57 is described below

commit 2ea2f8eb57a437eea503c3109afaf9b3fbf6cd35
Author: Dave Marion <dl...@apache.org>
AuthorDate: Wed Oct 26 13:13:08 2022 -0400

    Log the client address when FrameBuffer read or write methods return false (#3047)
    
    When FrameBuffer read and write methods return false it MAY be due to an
    error. Log at trace level the client address that it was trying to read from
    or write to. This will allow the user to modify the log level at runtime
    when they are seeing FrameBuffer errors being logged to try and identify
    the client.
    
    Closes #3042
---
 .../server/rpc/CustomNonBlockingServer.java         | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/CustomNonBlockingServer.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/CustomNonBlockingServer.java
index 65c5f5cd93..8fcc2496c6 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/CustomNonBlockingServer.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/CustomNonBlockingServer.java
@@ -128,6 +128,27 @@ public class CustomNonBlockingServer extends THsHaServer {
       }
       super.invoke();
     }
+
+    @Override
+    public boolean read() {
+      boolean result = super.read();
+      if (!result) {
+        log.trace("CustomFrameBuffer.read returned false when reading data from client: {}",
+            TServerUtils.clientAddress.get());
+      }
+      return result;
+    }
+
+    @Override
+    public boolean write() {
+      boolean result = super.write();
+      if (!result) {
+        log.trace("CustomFrameBuffer.write returned false when writing data to client: {}",
+            TServerUtils.clientAddress.get());
+      }
+      return result;
+    }
+
   }
 
 }