You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/09/12 17:59:09 UTC

[tomcat] branch master updated: ByteBufferUtils.cleanDirectBuffer invocation failures are logged

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

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 333f0a6  ByteBufferUtils.cleanDirectBuffer invocation failures are logged
333f0a6 is described below

commit 333f0a66ad71bd41f25807607d250781752d6ffe
Author: Carter Kozak <ck...@ckozak.net>
AuthorDate: Wed Sep 11 15:45:24 2019 -0700

    ByteBufferUtils.cleanDirectBuffer invocation failures are logged
    
    Previously cleanMethod failures were ignored entirely, and
    invokeCleanerMethod failures were logged to stderr using
    Throwable.printStackTrace().
    Now debug logging may be enabled to capture this information
    using the configured logging framework.
---
 java/org/apache/tomcat/util/buf/ByteBufferUtils.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/ByteBufferUtils.java b/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
index 407c1d7..f69c7b3 100644
--- a/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
+++ b/java/org/apache/tomcat/util/buf/ByteBufferUtils.java
@@ -124,15 +124,18 @@ public class ByteBufferUtils {
                 cleanMethod.invoke(cleanerMethod.invoke(buf));
             } catch (IllegalAccessException | IllegalArgumentException
                     | InvocationTargetException | SecurityException e) {
-                // Ignore
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("byteBufferUtils.cleaner"), e);
+                }
             }
         } else if (invokeCleanerMethod != null) {
             try {
                 invokeCleanerMethod.invoke(unsafe, buf);
             } catch (IllegalAccessException | IllegalArgumentException
                     | InvocationTargetException | SecurityException e) {
-                // Ignore
-                e.printStackTrace();
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("byteBufferUtils.cleaner"), e);
+                }
             }
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org