(tomcat) branch 9.0.x updated: Fix typo
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 997856b76c Fix typo 997856b76c is described below commit 997856b76c960f98611aa137ff4be377ffbef4f9 Author: Mark Thomas AuthorDate: Wed Apr 3 18:01:25 2024 +0100 Fix typo --- MERGE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MERGE.txt b/MERGE.txt index c63cb30d62..b73dfeeb8e 100644 --- a/MERGE.txt +++ b/MERGE.txt @@ -43,7 +43,7 @@ Codec Sub-tree: src/main/java/org/apache/commons/codec The SHA1 ID / tag for the most recent commit to be merged to Tomcat is: -rel/commons-codec-1.16,.1 (2024-02-09) +rel/commons-codec-1.16.1 (2024-02-09) Note: Only classes required for Base64 encoding/decoding. The rest are removed. FileUpload - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch 10.1.x updated: Fix typo
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new 02a32af0dd Fix typo 02a32af0dd is described below commit 02a32af0dd84a510279b9640f89e20d5c78a02af Author: Mark Thomas AuthorDate: Wed Apr 3 18:01:25 2024 +0100 Fix typo --- MERGE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MERGE.txt b/MERGE.txt index 647afe4dd5..8404019433 100644 --- a/MERGE.txt +++ b/MERGE.txt @@ -45,7 +45,7 @@ Unused code is removed Sub-tree: src/main/java/org/apache/commons/codec The SHA1 ID / tag for the most recent commit to be merged to Tomcat is: -rel/commons-codec-1.16,.1 (2024-02-09) +rel/commons-codec-1.16.1 (2024-02-09) Note: Only classes required for Base64 encoding/decoding. The rest are removed. FileUpload - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
(tomcat) branch main updated: Fix typo
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 309a6b0151 Fix typo 309a6b0151 is described below commit 309a6b0151fb7a227e21f6f39cd05d5046c2fd73 Author: Mark Thomas AuthorDate: Wed Apr 3 18:01:25 2024 +0100 Fix typo --- MERGE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MERGE.txt b/MERGE.txt index 647afe4dd5..8404019433 100644 --- a/MERGE.txt +++ b/MERGE.txt @@ -45,7 +45,7 @@ Unused code is removed Sub-tree: src/main/java/org/apache/commons/codec The SHA1 ID / tag for the most recent commit to be merged to Tomcat is: -rel/commons-codec-1.16,.1 (2024-02-09) +rel/commons-codec-1.16.1 (2024-02-09) Note: Only classes required for Base64 encoding/decoding. The rest are removed. FileUpload - 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: Also add a lock for connectors
This is an automated email from the ASF dual-hosted git repository. remm 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 047daa0d0f Also add a lock for connectors 047daa0d0f is described below commit 047daa0d0fc1ac7a388d1ee672d22501dae76e85 Author: remm AuthorDate: Wed Apr 3 16:49:11 2024 +0200 Also add a lock for connectors --- java/org/apache/catalina/core/StandardService.java | 107 +++-- webapps/docs/changelog.xml | 6 +- 2 files changed, 63 insertions(+), 50 deletions(-) diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java index a194c3dd6e..dbb32e55ce 100644 --- a/java/org/apache/catalina/core/StandardService.java +++ b/java/org/apache/catalina/core/StandardService.java @@ -20,6 +20,9 @@ package org.apache.catalina.core; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.management.ObjectName; @@ -76,7 +79,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * The set of Connectors associated with this Service. */ protected Connector connectors[] = new Connector[0]; -private final Object connectorsLock = new Object(); +private final ReadWriteLock connectorsLock = new ReentrantReadWriteLock(); /** * The list of executors held by the service. @@ -219,12 +222,16 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override public void addConnector(Connector connector) { -synchronized (connectorsLock) { +Lock writeLock = connectorsLock.writeLock(); +writeLock.lock(); +try { connector.setService(this); Connector results[] = new Connector[connectors.length + 1]; System.arraycopy(connectors, 0, results, 0, connectors.length); results[connectors.length] = connector; connectors = results; +} finally { +writeLock.unlock(); } try { @@ -241,12 +248,16 @@ public class StandardService extends LifecycleMBeanBase implements Service { public ObjectName[] getConnectorNames() { -synchronized (connectorsLock) { +Lock readLock = connectorsLock.readLock(); +readLock.lock(); +try { ObjectName results[] = new ObjectName[connectors.length]; for (int i = 0; i < results.length; i++) { results[i] = connectors[i].getObjectName(); } return results; +} finally { +readLock.unlock(); } } @@ -266,9 +277,13 @@ public class StandardService extends LifecycleMBeanBase implements Service { */ @Override public Connector[] findConnectors() { -synchronized (connectorsLock) { +Lock readLock = connectorsLock.readLock(); +readLock.lock(); +try { // shallow copy return connectors.clone(); +} finally { +readLock.unlock(); } } @@ -282,7 +297,9 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override public void removeConnector(Connector connector) { -synchronized (connectorsLock) { +Lock writeLock = connectorsLock.writeLock(); +writeLock.lock(); +try { int j = -1; for (int i = 0; i < connectors.length; i++) { if (connector == connectors[i]) { @@ -312,7 +329,10 @@ public class StandardService extends LifecycleMBeanBase implements Service { // Report this property change to interested listeners support.firePropertyChange("connector", connector, null); +} finally { +writeLock.unlock(); } + } @@ -443,12 +463,10 @@ public class StandardService extends LifecycleMBeanBase implements Service { mapperListener.start(); // Start our defined Connectors second -synchronized (connectorsLock) { -for (Connector connector : connectors) { -// If it has already failed, don't try and start it -if (connector.getState() != LifecycleState.FAILED) { -connector.start(); -} +for (Connector connector : findConnectors()) { +// If it has already failed, don't try and start it +if (connector.getState() != LifecycleState.FAILED) { +connector.start(); } } } @@ -463,28 +481,27 @@ public class StandardService extends LifecycleMBeanBase implements Service {
(tomcat) branch 10.1.x updated: Also add a lock for connectors
This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new e6b6e8c1c1 Also add a lock for connectors e6b6e8c1c1 is described below commit e6b6e8c1c1ebf2c542a36324a39120c0fb351ef9 Author: remm AuthorDate: Wed Apr 3 16:49:11 2024 +0200 Also add a lock for connectors --- java/org/apache/catalina/core/StandardService.java | 107 +++-- webapps/docs/changelog.xml | 6 +- 2 files changed, 63 insertions(+), 50 deletions(-) diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java index a194c3dd6e..dbb32e55ce 100644 --- a/java/org/apache/catalina/core/StandardService.java +++ b/java/org/apache/catalina/core/StandardService.java @@ -20,6 +20,9 @@ package org.apache.catalina.core; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.management.ObjectName; @@ -76,7 +79,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * The set of Connectors associated with this Service. */ protected Connector connectors[] = new Connector[0]; -private final Object connectorsLock = new Object(); +private final ReadWriteLock connectorsLock = new ReentrantReadWriteLock(); /** * The list of executors held by the service. @@ -219,12 +222,16 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override public void addConnector(Connector connector) { -synchronized (connectorsLock) { +Lock writeLock = connectorsLock.writeLock(); +writeLock.lock(); +try { connector.setService(this); Connector results[] = new Connector[connectors.length + 1]; System.arraycopy(connectors, 0, results, 0, connectors.length); results[connectors.length] = connector; connectors = results; +} finally { +writeLock.unlock(); } try { @@ -241,12 +248,16 @@ public class StandardService extends LifecycleMBeanBase implements Service { public ObjectName[] getConnectorNames() { -synchronized (connectorsLock) { +Lock readLock = connectorsLock.readLock(); +readLock.lock(); +try { ObjectName results[] = new ObjectName[connectors.length]; for (int i = 0; i < results.length; i++) { results[i] = connectors[i].getObjectName(); } return results; +} finally { +readLock.unlock(); } } @@ -266,9 +277,13 @@ public class StandardService extends LifecycleMBeanBase implements Service { */ @Override public Connector[] findConnectors() { -synchronized (connectorsLock) { +Lock readLock = connectorsLock.readLock(); +readLock.lock(); +try { // shallow copy return connectors.clone(); +} finally { +readLock.unlock(); } } @@ -282,7 +297,9 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override public void removeConnector(Connector connector) { -synchronized (connectorsLock) { +Lock writeLock = connectorsLock.writeLock(); +writeLock.lock(); +try { int j = -1; for (int i = 0; i < connectors.length; i++) { if (connector == connectors[i]) { @@ -312,7 +329,10 @@ public class StandardService extends LifecycleMBeanBase implements Service { // Report this property change to interested listeners support.firePropertyChange("connector", connector, null); +} finally { +writeLock.unlock(); } + } @@ -443,12 +463,10 @@ public class StandardService extends LifecycleMBeanBase implements Service { mapperListener.start(); // Start our defined Connectors second -synchronized (connectorsLock) { -for (Connector connector : connectors) { -// If it has already failed, don't try and start it -if (connector.getState() != LifecycleState.FAILED) { -connector.start(); -} +for (Connector connector : findConnectors()) { +// If it has already failed, don't try and start it +if (connector.getState() != LifecycleState.FAILED) { +connector.start(); } } } @@ -463,28 +481,27 @@ public class StandardService extends LifecycleMBeanBase implements Service
(tomcat) branch main updated: Also add a lock for connectors
This is an automated email from the ASF dual-hosted git repository. remm 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 a8360d3cbe Also add a lock for connectors a8360d3cbe is described below commit a8360d3cbe1d530391a23208de8faf0eea031245 Author: remm AuthorDate: Wed Apr 3 16:49:11 2024 +0200 Also add a lock for connectors --- java/org/apache/catalina/core/StandardService.java | 107 +++-- webapps/docs/changelog.xml | 6 +- 2 files changed, 63 insertions(+), 50 deletions(-) diff --git a/java/org/apache/catalina/core/StandardService.java b/java/org/apache/catalina/core/StandardService.java index a194c3dd6e..dbb32e55ce 100644 --- a/java/org/apache/catalina/core/StandardService.java +++ b/java/org/apache/catalina/core/StandardService.java @@ -20,6 +20,9 @@ package org.apache.catalina.core; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.management.ObjectName; @@ -76,7 +79,7 @@ public class StandardService extends LifecycleMBeanBase implements Service { * The set of Connectors associated with this Service. */ protected Connector connectors[] = new Connector[0]; -private final Object connectorsLock = new Object(); +private final ReadWriteLock connectorsLock = new ReentrantReadWriteLock(); /** * The list of executors held by the service. @@ -219,12 +222,16 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override public void addConnector(Connector connector) { -synchronized (connectorsLock) { +Lock writeLock = connectorsLock.writeLock(); +writeLock.lock(); +try { connector.setService(this); Connector results[] = new Connector[connectors.length + 1]; System.arraycopy(connectors, 0, results, 0, connectors.length); results[connectors.length] = connector; connectors = results; +} finally { +writeLock.unlock(); } try { @@ -241,12 +248,16 @@ public class StandardService extends LifecycleMBeanBase implements Service { public ObjectName[] getConnectorNames() { -synchronized (connectorsLock) { +Lock readLock = connectorsLock.readLock(); +readLock.lock(); +try { ObjectName results[] = new ObjectName[connectors.length]; for (int i = 0; i < results.length; i++) { results[i] = connectors[i].getObjectName(); } return results; +} finally { +readLock.unlock(); } } @@ -266,9 +277,13 @@ public class StandardService extends LifecycleMBeanBase implements Service { */ @Override public Connector[] findConnectors() { -synchronized (connectorsLock) { +Lock readLock = connectorsLock.readLock(); +readLock.lock(); +try { // shallow copy return connectors.clone(); +} finally { +readLock.unlock(); } } @@ -282,7 +297,9 @@ public class StandardService extends LifecycleMBeanBase implements Service { @Override public void removeConnector(Connector connector) { -synchronized (connectorsLock) { +Lock writeLock = connectorsLock.writeLock(); +writeLock.lock(); +try { int j = -1; for (int i = 0; i < connectors.length; i++) { if (connector == connectors[i]) { @@ -312,7 +329,10 @@ public class StandardService extends LifecycleMBeanBase implements Service { // Report this property change to interested listeners support.firePropertyChange("connector", connector, null); +} finally { +writeLock.unlock(); } + } @@ -443,12 +463,10 @@ public class StandardService extends LifecycleMBeanBase implements Service { mapperListener.start(); // Start our defined Connectors second -synchronized (connectorsLock) { -for (Connector connector : connectors) { -// If it has already failed, don't try and start it -if (connector.getState() != LifecycleState.FAILED) { -connector.start(); -} +for (Connector connector : findConnectors()) { +// If it has already failed, don't try and start it +if (connector.getState() != LifecycleState.FAILED) { +connector.start(); } } } @@ -463,28 +481,27 @@ public class StandardService extends LifecycleMBeanBase implements Service {
Participate in the ASF 25th Anniversary Campaign
Hi everyone, As part of The ASF’s 25th anniversary campaign[1], we will be celebrating projects and communities in multiple ways. We invite all projects and contributors to participate in the following ways: * Individuals - submit your first contribution: https://news.apache.org/foundation/entry/the-asf-launches-firstasfcontribution-campaign * Projects - share your public good story: https://docs.google.com/forms/d/1vuN-tUnBwpTgOE5xj3Z5AG1hsOoDNLBmGIqQHwQT6k8/viewform?edit_requested=true * Projects - submit a project spotlight for the blog: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=278466116 * Projects - contact the Voice of Apache podcast (formerly Feathercast) to be featured: https://feathercast.apache.org/help/ * Projects - use the 25th anniversary template and the #ASF25Years hashtag on social media: https://docs.google.com/presentation/d/1oDbMol3F_XQuCmttPYxBIOIjRuRBksUjDApjd8Ve3L8/edit#slide=id.g26b0919956e_0_13 If you have questions, email the Marketing & Publicity team at mark...@apache.org. Peace, BKP [1] https://apache.org/asf25years/ [NOTE: You are receiving this message because you are a contributor to an Apache Software Foundation project. The ASF will very occasionally send out messages relating to the Foundation to contributors and members, such as this one.] Brian Proffitt VP, Marketing & Publicity VP, Conferences