[tomcat] branch main updated: Deprecate unused code

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new c20fe6a  Deprecate unused code
c20fe6a is described below

commit c20fe6a58697bd987c38a46bffbc9f6e1bda3f43
Author: Mark Thomas 
AuthorDate: Mon Nov 29 09:35:09 2021 +

Deprecate unused code
---
 java/org/apache/catalina/manager/StatusManagerServlet.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/java/org/apache/catalina/manager/StatusManagerServlet.java 
b/java/org/apache/catalina/manager/StatusManagerServlet.java
index c936ad2..aed8163 100644
--- a/java/org/apache/catalina/manager/StatusManagerServlet.java
+++ b/java/org/apache/catalina/manager/StatusManagerServlet.java
@@ -61,7 +61,10 @@ public class StatusManagerServlet
 
 /**
  * Vector of protocol handlers object names.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1.x
  */
+@Deprecated
 protected final Vector protocolHandlers = new Vector<>();
 
 

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



[tomcat] branch 10.0.x updated: Deprecate unused code

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 5840680  Deprecate unused code
5840680 is described below

commit 5840680f78bad4f928c0ced5a7a081e8abc13211
Author: Mark Thomas 
AuthorDate: Mon Nov 29 09:35:09 2021 +

Deprecate unused code
---
 java/org/apache/catalina/manager/StatusManagerServlet.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/java/org/apache/catalina/manager/StatusManagerServlet.java 
b/java/org/apache/catalina/manager/StatusManagerServlet.java
index e4cb5dd..97dac13 100644
--- a/java/org/apache/catalina/manager/StatusManagerServlet.java
+++ b/java/org/apache/catalina/manager/StatusManagerServlet.java
@@ -61,7 +61,10 @@ public class StatusManagerServlet
 
 /**
  * Vector of protocol handlers object names.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1.x
  */
+@Deprecated
 protected final Vector protocolHandlers = new Vector<>();
 
 

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



[tomcat] branch 9.0.x updated: Deprecate unused code

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 894fe84  Deprecate unused code
894fe84 is described below

commit 894fe845ba49942eaefee7a27583a8225398634d
Author: Mark Thomas 
AuthorDate: Mon Nov 29 09:35:09 2021 +

Deprecate unused code
---
 java/org/apache/catalina/manager/StatusManagerServlet.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/java/org/apache/catalina/manager/StatusManagerServlet.java 
b/java/org/apache/catalina/manager/StatusManagerServlet.java
index be29a8c..9ea16b4 100644
--- a/java/org/apache/catalina/manager/StatusManagerServlet.java
+++ b/java/org/apache/catalina/manager/StatusManagerServlet.java
@@ -60,7 +60,10 @@ public class StatusManagerServlet
 
 /**
  * Vector of protocol handlers object names.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1.x
  */
+@Deprecated
 protected final Vector protocolHandlers = new Vector<>();
 
 

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



[tomcat] branch main updated: Remove unused code

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 2ac59cb  Remove unused code
2ac59cb is described below

commit 2ac59cbf8469eef503b50849476fb9bd372f0057
Author: Mark Thomas 
AuthorDate: Mon Nov 29 09:40:15 2021 +

Remove unused code
---
 .../catalina/manager/StatusManagerServlet.java | 31 +++---
 1 file changed, 4 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/catalina/manager/StatusManagerServlet.java 
b/java/org/apache/catalina/manager/StatusManagerServlet.java
index aed8163..2ba347b 100644
--- a/java/org/apache/catalina/manager/StatusManagerServlet.java
+++ b/java/org/apache/catalina/manager/StatusManagerServlet.java
@@ -60,15 +60,6 @@ public class StatusManagerServlet
 
 
 /**
- * Vector of protocol handlers object names.
- *
- * @deprecated Unused. Will be removed in Tomcat 10.1.x
- */
-@Deprecated
-protected final Vector protocolHandlers = new Vector<>();
-
-
-/**
  * Vector of thread pools object names.
  */
 protected final Vector threadPools = new Vector<>();
@@ -107,23 +98,13 @@ public class StatusManagerServlet
 
 try {
 
-// Query protocol handlers
-String onStr = "*:type=ProtocolHandler,*";
+// Query Thread Pools
+String onStr = "*:type=ThreadPool,*";
 ObjectName objectName = new ObjectName(onStr);
 Set set = mBeanServer.queryMBeans(objectName, 
null);
 Iterator iterator = set.iterator();
 while (iterator.hasNext()) {
 ObjectInstance oi = iterator.next();
-protocolHandlers.addElement(oi.getObjectName());
-}
-
-// Query Thread Pools
-onStr = "*:type=ThreadPool,*";
-objectName = new ObjectName(onStr);
-set = mBeanServer.queryMBeans(objectName, null);
-iterator = set.iterator();
-while (iterator.hasNext()) {
-ObjectInstance oi = iterator.next();
 threadPools.addElement(oi.getObjectName());
 }
 
@@ -363,9 +344,7 @@ public class StatusManagerServlet
 (MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
 String type = objectName.getKeyProperty("type");
 if (type != null) {
-if (type.equals("ProtocolHandler")) {
-protocolHandlers.addElement(objectName);
-} else if (type.equals("ThreadPool")) {
+if (type.equals("ThreadPool")) {
 threadPools.addElement(objectName);
 } else if (type.equals("GlobalRequestProcessor")) {
 globalRequestProcessors.addElement(objectName);
@@ -377,9 +356,7 @@ public class StatusManagerServlet
(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {
 String type = objectName.getKeyProperty("type");
 if (type != null) {
-if (type.equals("ProtocolHandler")) {
-protocolHandlers.removeElement(objectName);
-} else if (type.equals("ThreadPool")) {
+if (type.equals("ThreadPool")) {
 threadPools.removeElement(objectName);
 } else if (type.equals("GlobalRequestProcessor")) {
 globalRequestProcessors.removeElement(objectName);

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



[Bug 65710] New: multipartfile stream close doesn't release the handle

2021-11-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65710

Bug ID: 65710
   Summary: multipartfile stream close doesn't release the handle
   Product: Tomcat 9
   Version: 9.0.54
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: promena...@163.com
  Target Milestone: -

Hi
  When i upload a file using tomcat 9.0.54, the input parameters is
Multipartfile,finally I closed the Inputstream, but it will not release the
handle in Linux, /proc/*/fd will increase to the limit. 
 this problem will not appeared in tomcat 9.0.52.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65710] multipartfile stream close doesn't release the handle

2021-11-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65710

--- Comment #1 from Mark Thomas  ---
Possibly related to the Commons File Upload update in 9.0.53

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated: Fix (hopefully) intermittently failing test

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 5782322  Fix (hopefully) intermittently failing test
5782322 is described below

commit 5782322afd31adf98b72288f99965c6811dcdcdd
Author: Mark Thomas 
AuthorDate: Mon Nov 29 17:09:45 2021 +

Fix (hopefully) intermittently failing test
---
 java/org/apache/coyote/http2/Stream.java | 10 --
 webapps/docs/changelog.xml   |  6 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 5ad9396..e3d6fa8 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -660,8 +660,14 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 log.debug(sm.getString("stream.reset.send", 
getConnectionId(), getIdAsString(),
 se.getError()));
 }
-state.sendReset();
-handler.sendStreamReset(se);
+// Sync ensures that if the call to sendReset() triggers resets
+// in other threads, that the RST frame associated with this
+// thread is sent before the RST frames associated with those
+// threads.
+synchronized (state) {
+state.sendReset();
+handler.sendStreamReset(se);
+}
 cancelAllocationRequests();
 if (inputBuffer != null) {
 inputBuffer.swallowUnread();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index d30b852..edeef04 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -170,6 +170,11 @@
 65677: Improve exception handling for errors during HTTP/1.1
 reads with NIO2. (markt)
   
+  
+When an error occurs that triggers a stream reset, ensure that the 
first
+RST frame sent to the client is the one associated with 
the
+error that triggered the reset. (markt)
+  
 
   
   
@@ -1205,3 +1210,4 @@
 
 
 
+

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



[tomcat] branch 10.0.x updated: Fix (hopefully) intermittently failing test

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 6b13268  Fix (hopefully) intermittently failing test
6b13268 is described below

commit 6b1326870e0ae768cb8c4d51413c06e636ebbc9a
Author: Mark Thomas 
AuthorDate: Mon Nov 29 17:09:45 2021 +

Fix (hopefully) intermittently failing test
---
 java/org/apache/coyote/http2/Stream.java | 10 --
 webapps/docs/changelog.xml   |  6 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index cad1079..19f289b 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -655,8 +655,14 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 log.debug(sm.getString("stream.reset.send", 
getConnectionId(), getIdAsString(),
 se.getError()));
 }
-state.sendReset();
-handler.sendStreamReset(se);
+// Sync ensures that if the call to sendReset() triggers resets
+// in other threads, that the RST frame associated with this
+// thread is sent before the RST frames associated with those
+// threads.
+synchronized (state) {
+state.sendReset();
+handler.sendStreamReset(se);
+}
 cancelAllocationRequests();
 if (inputBuffer != null) {
 inputBuffer.swallowUnread();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4deeb0f..8ec7987 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -162,6 +162,11 @@
 Refactor APR/native connector shutdown to remove a potential source of
 JVM crashes on shutdown when sendfile is used. (markt)
   
+  
+When an error occurs that triggers a stream reset, ensure that the 
first
+RST frame sent to the client is the one associated with 
the
+error that triggered the reset. (markt)
+  
 
   
 
@@ -3300,3 +3305,4 @@
 
 
 
+

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



[tomcat] branch 9.0.x updated: Fix (hopefully) intermittently failing test

2021-11-29 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new b99d75a  Fix (hopefully) intermittently failing test
b99d75a is described below

commit b99d75ad6bd14bf7c8f868faae080e6693a02c10
Author: Mark Thomas 
AuthorDate: Mon Nov 29 17:09:45 2021 +

Fix (hopefully) intermittently failing test
---
 java/org/apache/coyote/http2/Stream.java | 10 --
 webapps/docs/changelog.xml   |  6 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 307d2a9..df2ea10 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -655,8 +655,14 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 log.debug(sm.getString("stream.reset.send", 
getConnectionId(), getIdAsString(),
 se.getError()));
 }
-state.sendReset();
-handler.sendStreamReset(se);
+// Sync ensures that if the call to sendReset() triggers resets
+// in other threads, that the RST frame associated with this
+// thread is sent before the RST frames associated with those
+// threads.
+synchronized (state) {
+state.sendReset();
+handler.sendStreamReset(se);
+}
 cancelAllocationRequests();
 if (inputBuffer != null) {
 inputBuffer.swallowUnread();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 5e5d69c..0e88b55 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -162,6 +162,11 @@
 Refactor APR/native connector shutdown to remove a potential source of
 JVM crashes on shutdown when sendfile is used. (markt)
   
+  
+When an error occurs that triggers a stream reset, ensure that the 
first
+RST frame sent to the client is the one associated with 
the
+error that triggered the reset. (markt)
+  
 
   
   
@@ -12099,3 +12104,4 @@
 
 
 
+

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



[tomcat] branch 8.5.x updated: Fix (hopefully) intermittently failing test

2021-11-29 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 2436c18  Fix (hopefully) intermittently failing test
2436c18 is described below

commit 2436c1808efb1f3b5c8847ae6a1c718e0748cbc2
Author: Mark Thomas 
AuthorDate: Mon Nov 29 17:09:45 2021 +

Fix (hopefully) intermittently failing test
---
 java/org/apache/coyote/http2/Stream.java | 10 --
 webapps/docs/changelog.xml   |  6 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 1c5d6c7..12e507d 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -614,8 +614,14 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 log.debug(sm.getString("stream.reset.send", 
getConnectionId(), getIdAsString(),
 se.getError()));
 }
-state.sendReset();
-handler.sendStreamReset(se);
+// Sync ensures that if the call to sendReset() triggers resets
+// in other threads, that the RST frame associated with this
+// thread is sent before the RST frames associated with those
+// threads.
+synchronized (state) {
+state.sendReset();
+handler.sendStreamReset(se);
+}
 cancelAllocationRequests();
 if (inputBuffer != null) {
 inputBuffer.swallowUnread();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9a9af08..49f30a4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -155,6 +155,11 @@
 Refactor APR/native connector shutdown to remove a potential source of
 JVM crashes on shutdown when sendfile is used. (markt)
   
+  
+When an error occurs that triggers a stream reset, ensure that the 
first
+RST frame sent to the client is the one associated with 
the
+error that triggered the reset. (markt)
+  
 
   
   
@@ -10268,3 +10273,4 @@
 
 
 
+

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



[Bug 65710] multipartfile stream close doesn't release the handle

2021-11-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65710

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #2 from Mark Thomas  ---
A manual code review didn't identify any potential leaks.

A simple test web application running on the latest 9.0.x does not show an
increase in file handles associated with the Tomcat process after uploading a
file using @MultipartConfig.

To investigate this further we are going to need the simplest possible test
case (i.e. a single Servlet) - with source code - that demonstrates this issue
on a clean install of the latest stable 9.0.x release (9.0.55 at the time of
writing).

Without a test case that demonstrates this issue this report will eventually
get closed as WORKSFORME.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 65710] multipartfile stream close doesn't release the handle

2021-11-29 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65710

--- Comment #3 from promena...@163.com ---
In this case. there are already exists handle leaks. Tomcat 9.0.52 can
autoRelease it. Tomcat 9.0.54 will not.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org