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/10/10 10:21:22 UTC

[tomcat] branch 8.5.x updated (20c39e9 -> 7839aab)

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

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


    from 20c39e9  Use consistent format
     new 7c31429  Expand debugging for async processing
     new 7839aab  Add debug logging of read/write interest registration

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/coyote/AbstractProcessor.java           | 16 +++++++++++++---
 java/org/apache/coyote/AbstractProcessorLight.java      |  3 +++
 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 ++++++
 6 files changed, 36 insertions(+), 3 deletions(-)


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


[tomcat] 01/02: Expand debugging for async processing

Posted by ma...@apache.org.
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 7c3142921a56c4e071dfd711b24c133542e4733d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Oct 9 16:35:42 2019 +0100

    Expand debugging for async processing
---
 java/org/apache/coyote/AbstractProcessor.java      | 16 +++++++++++++---
 java/org/apache/coyote/AbstractProcessorLight.java |  3 +++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProcessor.java b/java/org/apache/coyote/AbstractProcessor.java
index d3f214c..357e052 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -257,15 +257,25 @@ public abstract class AbstractProcessor extends AbstractProcessorLight implement
 
         rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
 
+        SocketState state;
+
         if (getErrorState().isError()) {
             request.updateCounters();
-            return SocketState.CLOSED;
+            state = SocketState.CLOSED;
         } else if (isAsync()) {
-            return SocketState.LONG;
+            state = SocketState.LONG;
         } else {
             request.updateCounters();
-            return dispatchEndRequest();
+            state = dispatchEndRequest();
+        }
+
+        if (getLog().isDebugEnabled()) {
+            getLog().debug("Socket: [" + socketWrapper +
+                    "], Status in: [" + status +
+                    "], State out: [" + state + "]");
         }
+
+        return state;
     }
 
 
diff --git a/java/org/apache/coyote/AbstractProcessorLight.java b/java/org/apache/coyote/AbstractProcessorLight.java
index 7d0b6e0..049797d 100644
--- a/java/org/apache/coyote/AbstractProcessorLight.java
+++ b/java/org/apache/coyote/AbstractProcessorLight.java
@@ -46,6 +46,9 @@ public abstract class AbstractProcessorLight implements Processor {
         do {
             if (dispatches != null) {
                 DispatchType nextDispatch = dispatches.next();
+                if (getLog().isDebugEnabled()) {
+                    getLog().debug("Processing dispatch type: [" + nextDispatch + "]");
+                }
                 state = dispatch(nextDispatch.getSocketStatus());
             } else if (status == SocketEvent.DISCONNECT) {
                 // Do nothing here, just wait for it to get recycled


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


[tomcat] 02/02: Add debug logging of read/write interest registration

Posted by ma...@apache.org.
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org