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

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

commit 7839aab8ae4532a4332ba4d0102fc9a99326f950
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Oct 9 21:51:24 2019 +0100

    Add debug logging of read/write interest registration
---
 java/org/apache/tomcat/util/net/AprEndpoint.java        | 6 ++++++
 java/org/apache/tomcat/util/net/LocalStrings.properties | 2 ++
 java/org/apache/tomcat/util/net/Nio2Endpoint.java       | 6 ++++++
 java/org/apache/tomcat/util/net/NioEndpoint.java        | 6 ++++++
 4 files changed, 20 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index 4c1ca49..5af9fe0 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -2555,6 +2555,9 @@ public class AprEndpoint extends AbstractEndpoint<Long> 
implements SNICallBack {
                 if (closed) {
                     return;
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("endpoint.debug.registerRead", 
this));
+                }
                 Poller p = ((AprEndpoint) getEndpoint()).getPoller();
                 if (p != null) {
                     p.add(getSocket().longValue(), getReadTimeout(), 
Poll.APR_POLLIN);
@@ -2570,6 +2573,9 @@ public class AprEndpoint extends AbstractEndpoint<Long> 
implements SNICallBack {
                 if (closed) {
                     return;
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("endpoint.debug.registerWrite", 
this));
+                }
                 ((AprEndpoint) getEndpoint()).getPoller().add(
                         getSocket().longValue(), getWriteTimeout(), 
Poll.APR_POLLOUT);
             }
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 8abe55e..7bca289 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -67,6 +67,8 @@ endpoint.debug.pollerAddDo=Add to poller socket [{0}]
 endpoint.debug.pollerProcess=Processing socket [{0}] for event(s) [{1}]
 endpoint.debug.pollerRemove=Attempting to remove [{0}] from poller
 endpoint.debug.pollerRemoved=Removed [{0}] from poller
+endpoint.debug.registerRead=Registered read interest for [{0}]
+endpoint.debug.registerWrite=Registered write interest for [{0}]
 endpoint.debug.socket=socket [{0}]
 endpoint.debug.socketCloseFail=Failed to close socket
 endpoint.debug.socketTimeout=Timing out [{0}]
diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 83be183..030236e 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -1497,6 +1497,9 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint<Nio2Channel> {
                 if (readNotify) {
                     return;
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("endpoint.debug.registerRead", 
this));
+                }
                 readInterest = true;
                 if (readPending.tryAcquire()) {
                     // No read pending, so do a read
@@ -1522,6 +1525,9 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint<Nio2Channel> {
                 if (writeNotify) {
                     return;
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug(sm.getString("endpoint.debug.registerWrite", 
this));
+                }
                 writeInterest = true;
                 if (writePending.availablePermits() == 1) {
                     // If no write is pending, notify that writing is possible
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 45613aa..3526687 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1327,12 +1327,18 @@ public class NioEndpoint extends 
AbstractJsseEndpoint<NioChannel> {
 
         @Override
         public void registerReadInterest() {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("endpoint.debug.registerRead", this));
+            }
             getPoller().add(getSocket(), SelectionKey.OP_READ);
         }
 
 
         @Override
         public void registerWriteInterest() {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("endpoint.debug.registerWrite", this));
+            }
             getPoller().add(getSocket(), SelectionKey.OP_WRITE);
         }
 


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

Reply via email to