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:19:09 UTC
[tomcat] branch master updated (bdbc534 -> 7afcf7a)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.
from bdbc534 Use consistent format
new ee2e35b Expand debugging for async processing
new 7afcf7a 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] 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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 7afcf7a695cca5c8d0c05c28059c905f467b0d92
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 3f9cb3b..8c0d484 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -2410,6 +2410,9 @@ public class AprEndpoint extends AbstractEndpoint<Long,Long> implements SNICallB
if (isClosed()) {
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);
@@ -2425,6 +2428,9 @@ public class AprEndpoint extends AbstractEndpoint<Long,Long> implements SNICallB
if (isClosed()) {
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 3eed259..0fdd2df 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -68,6 +68,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.socketTimeout=Timing out [{0}]
endpoint.debug.unlock.fail=Caught exception trying to unlock accept on port [{0}]
diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 4bb8ba1..e61215b 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -1368,6 +1368,9 @@ public class Nio2Endpoint extends AbstractJsseEndpoint<Nio2Channel,AsynchronousS
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
@@ -1395,6 +1398,9 @@ public class Nio2Endpoint extends AbstractJsseEndpoint<Nio2Channel,AsynchronousS
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 150bcf5..84b3003 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1277,12 +1277,18 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel>
@Override
public void registerReadInterest() {
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("endpoint.debug.registerRead", this));
+ }
getPoller().add(this, SelectionKey.OP_READ);
}
@Override
public void registerWriteInterest() {
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("endpoint.debug.registerWrite", this));
+ }
getPoller().add(this, SelectionKey.OP_WRITE);
}
---------------------------------------------------------------------
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 master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit ee2e35b364de64f478b746d40d7bf2352cc97006
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 03984f9..fc32745 100644
--- a/java/org/apache/coyote/AbstractProcessor.java
+++ b/java/org/apache/coyote/AbstractProcessor.java
@@ -252,15 +252,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