[tomcat] branch master updated: Fix incorrect default value of maxThreads in cluster receiver docs.
This is an automated email from the ASF dual-hosted git repository. kfujino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/master by this push: new 25eaa18 Fix incorrect default value of maxThreads in cluster receiver docs. 25eaa18 is described below commit 25eaa186bd82ae3a1833f2b27f11db90243c2ab4 Author: KeiichiFujino AuthorDate: Thu Sep 26 16:59:04 2019 +0900 Fix incorrect default value of maxThreads in cluster receiver docs. --- webapps/docs/config/cluster-receiver.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapps/docs/config/cluster-receiver.xml b/webapps/docs/config/cluster-receiver.xml index fb9a5c1..9bc1b53 100644 --- a/webapps/docs/config/cluster-receiver.xml +++ b/webapps/docs/config/cluster-receiver.xml @@ -103,7 +103,7 @@ The default value is a very high 5000 milliseconds. - The maximum number of threads in the receiver thread pool. The default value is 6 + The maximum number of threads in the receiver thread pool. The default value is 15 Adjust this value relative to the number of nodes in the cluster, the number of messages being exchanged and the hardware you are running on. A higher value doesn't mean more efficiency, tune this value according to your own test results. - 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 incorrect default value of maxThreads in cluster receiver docs.
This is an automated email from the ASF dual-hosted git repository. kfujino 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 5dda8bf Fix incorrect default value of maxThreads in cluster receiver docs. 5dda8bf is described below commit 5dda8bf3b18290ccc2ab0cbdeba37cacb8ef46da Author: KeiichiFujino AuthorDate: Thu Sep 26 17:11:11 2019 +0900 Fix incorrect default value of maxThreads in cluster receiver docs. --- webapps/docs/config/cluster-receiver.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapps/docs/config/cluster-receiver.xml b/webapps/docs/config/cluster-receiver.xml index fb9a5c1..9bc1b53 100644 --- a/webapps/docs/config/cluster-receiver.xml +++ b/webapps/docs/config/cluster-receiver.xml @@ -103,7 +103,7 @@ The default value is a very high 5000 milliseconds. - The maximum number of threads in the receiver thread pool. The default value is 6 + The maximum number of threads in the receiver thread pool. The default value is 15 Adjust this value relative to the number of nodes in the cluster, the number of messages being exchanged and the hardware you are running on. A higher value doesn't mean more efficiency, tune this value according to your own test results. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 7.0.x updated: Fix incorrect default value of maxThreads in cluster receiver docs.
This is an automated email from the ASF dual-hosted git repository. kfujino pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/7.0.x by this push: new 05c153d Fix incorrect default value of maxThreads in cluster receiver docs. 05c153d is described below commit 05c153de637c67493fa9c7702e475f5810dc4cde Author: KeiichiFujino AuthorDate: Thu Sep 26 17:14:12 2019 +0900 Fix incorrect default value of maxThreads in cluster receiver docs. --- webapps/docs/config/cluster-receiver.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapps/docs/config/cluster-receiver.xml b/webapps/docs/config/cluster-receiver.xml index 735d1c1..b1c86d1 100644 --- a/webapps/docs/config/cluster-receiver.xml +++ b/webapps/docs/config/cluster-receiver.xml @@ -103,7 +103,7 @@ The default value is a very high 5000 milliseconds. - The maximum number of threads in the receiver thread pool. The default value is 6 + The maximum number of threads in the receiver thread pool. The default value is 15 Adjust this value relative to the number of nodes in the cluster, the number of messages being exchanged and the hardware you are running on. A higher value doesn't mean more efficiency, tune this value according to your own test results. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Correct regression that prevented loading config files from class path
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 The following commit(s) were added to refs/heads/master by this push: new e22624f Correct regression that prevented loading config files from class path e22624f is described below commit e22624f976fe653bd9acb2ab3c14285f1c301d59 Author: Mark Thomas AuthorDate: Thu Sep 26 11:56:26 2019 +0100 Correct regression that prevented loading config files from class path --- .../catalina/startup/CatalinaBaseConfigurationSource.java | 15 +-- webapps/docs/changelog.xml| 8 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java b/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java index 9c3e208..51b3b85 100644 --- a/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java +++ b/java/org/apache/catalina/startup/CatalinaBaseConfigurationSource.java @@ -89,14 +89,17 @@ public class CatalinaBaseConfigurationSource implements ConfigurationSource { } // Try classloader -try(InputStream stream = getClass().getClassLoader().getResourceAsStream(name)) { -if (stream != null) { +InputStream stream = getClass().getClassLoader().getResourceAsStream(name); +if (stream != null) { +try { return new Resource(stream, getClass().getClassLoader().getResource(name).toURI()); +} catch (InvalidPathException e) { +// Ignore. Some valid file URIs can trigger this. +stream.close(); +} catch (URISyntaxException e) { +stream.close(); +throw new IOException(sm.getString("catalinaConfigurationSource.cannotObtainURL", name), e); } -} catch (InvalidPathException e) { -// Ignore. Some valid file URIs can trigger this. -} catch (URISyntaxException e) { -throw new IOException(sm.getString("catalinaConfigurationSource.cannotObtainURL", name), e); } // Then try URI. diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 63e4b12..840fecf 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -45,6 +45,14 @@ issues do not "pop up" wrt. others). --> + + + +Correct a regression introduced in 9.0.25 that prevented configuration +files from being loaded from the class path. (markt) + + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766
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 The following commit(s) were added to refs/heads/master by this push: new 70ad92e Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 70ad92e is described below commit 70ad92ec5126d07a13366cff22996895ef9604b6 Author: Mark Thomas AuthorDate: Thu Sep 26 20:27:24 2019 +0100 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 Clean-up correctly after an early failure of a WebSocket connection. --- java/org/apache/coyote/AbstractProtocol.java | 8 webapps/docs/changelog.xml | 5 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java index d95d425..9753447 100644 --- a/java/org/apache/coyote/AbstractProtocol.java +++ b/java/org/apache/coyote/AbstractProtocol.java @@ -956,8 +956,9 @@ public abstract class AbstractProtocol implements ProtocolHandler, // The resumeProcessing() method will add this socket // to the poller. } else { -// Connection closed. OK to recycle the processor. Upgrade -// processors are not recycled. +// Connection closed. OK to recycle the processor. +// Processors handling upgrades require additional clean-up +// before release. connections.remove(socket); if (processor.isUpgrade()) { UpgradeToken upgradeToken = processor.getUpgradeToken(); @@ -979,9 +980,8 @@ public abstract class AbstractProtocol implements ProtocolHandler, upgradeToken.getContextBind().unbind(false, oldCL); } } -} else { -release(processor); } +release(processor); } return state; } catch(java.net.SocketException e) { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 840fecf..41d9f3f 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -64,6 +64,11 @@ 63765: NIO2 should try to unwrap after TLS handshake to avoid edge cases. (remm) + +63766: Ensure Processor objects are recycled when processing +an HTTP upgrade connection that terminates before processing switches to +the Processor for the upgraded procotol. (markt) + - 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 https://bz.apache.org/bugzilla/show_bug.cgi?id=63766
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 8c2f067 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 8c2f067 is described below commit 8c2f067f39986724c8eba228e396358a837bd0fe Author: Mark Thomas AuthorDate: Thu Sep 26 20:27:24 2019 +0100 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 Clean-up correctly after an early failure of a WebSocket connection. --- java/org/apache/coyote/AbstractProtocol.java | 8 webapps/docs/changelog.xml | 5 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java index 3f5c651..d3f9166 100644 --- a/java/org/apache/coyote/AbstractProtocol.java +++ b/java/org/apache/coyote/AbstractProtocol.java @@ -900,8 +900,9 @@ public abstract class AbstractProtocol implements ProtocolHandler, // The resumeProcessing() method will add this socket // to the poller. } else { -// Connection closed. OK to recycle the processor. Upgrade -// processors are not recycled. +// Connection closed. OK to recycle the processor. +// Processors handling upgrades require additional clean-up +// before release. connections.remove(socket); if (processor.isUpgrade()) { UpgradeToken upgradeToken = processor.getUpgradeToken(); @@ -923,9 +924,8 @@ public abstract class AbstractProtocol implements ProtocolHandler, upgradeToken.getContextBind().unbind(false, oldCL); } } -} else { -release(processor); } +release(processor); } return state; } catch(java.net.SocketException e) { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 58e7569..401ad14 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -56,6 +56,11 @@ 63765: NIO2 should try to unwrap after TLS handshake to avoid edge cases. (remm) + +63766: Ensure Processor objects are recycled when processing +an HTTP upgrade connection that terminates before processing switches to +the Processor for the upgraded procotol. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/7.0.x by this push: new 5c32af4 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 5c32af4 is described below commit 5c32af4b01f76b64c44da51ed5da40c4d2bab25b Author: Mark Thomas AuthorDate: Thu Sep 26 20:36:26 2019 +0100 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 Clean-up correctly after an early failure of a WebSocket connection. --- java/org/apache/coyote/AbstractProtocol.java | 4 +++- webapps/docs/changelog.xml | 5 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java index bf5308f..cfe301e 100644 --- a/java/org/apache/coyote/AbstractProtocol.java +++ b/java/org/apache/coyote/AbstractProtocol.java @@ -727,10 +727,12 @@ public abstract class AbstractProtocol implements ProtocolHandler, } } else { // Connection closed. OK to recycle the processor. Upgrade -// processors are not recycled. +// processors are not re-used but recycle is called to clear +// references. connections.remove(socket); if (processor.isUpgrade()) { processor.getHttpUpgradeHandler().destroy(); +processor.recycle(true); } else if (processor instanceof org.apache.coyote.http11.upgrade.UpgradeProcessor) { // NO-OP } else { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 6d6812e..d0f6e64 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -135,6 +135,11 @@ accept-encoding header to determine if gzip encoding is supported including only parsing the first header found. (markt) + +63766: Ensure Processor objects are recycled when processing +an HTTP upgrade connection that terminates before processing switches to +the Processor for the upgraded procotol. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 63766] Resource leak: under certain conditions, request objects related to WebSockets are not freed
https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 Mark Thomas changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Mark Thomas --- Thanks for the report and the test case. It makes it so much easier to track down and fix bugs when you have this much information to start from. For the record, it was not what would normally a resource leak. More a failure to clean-up in a timely manner. Given enough (error free) further processing, the objects would have been cleaned up. Fixed in: - master for 9.0.27 onwards - 8.5.x for 8.5.47 onwards - 7.0.x for 7.0.97 onwards -- 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 63767] install windows service, tomcat9 start crash.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63767 --- Comment #9 from Christopher Schultz --- (In reply to Mark Thomas from comment #6) > Found it. A good demonstration of my lack of C coding skills. I failed to > initialise a variable so it was non-NULL when I expected it to be NULL This should be caught by the compiler, even if it's a non-fatal compiler error. Can you confirm that the compiler didn't complain about it? Perhaps there are more compiler flags we can add to the build in order to convert a non-fatal error into a fatal one. -- 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 63766] Resource leak: under certain conditions, request objects related to WebSockets are not freed
https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 --- Comment #5 from Francis VAN AEKEN --- Thank you for addressing this issue so swiftly. We are impressed. Keep up the good work! -- 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 8.5.x updated (8c2f067 -> 2a26382)
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 8c2f067 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 new d817d1e Align with 9.0.x. Spacing, Javadoc new 2a26382 Add throwOnFailure to LifecycleBase. 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/catalina/util/LifecycleBase.java | 102 --- 1 file changed, 73 insertions(+), 29 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Add throwOnFailure to LifecycleBase.
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 2a263824b95000e331ddc1cdf2694b472dddfc87 Author: Mark Thomas AuthorDate: Fri Oct 7 08:54:34 2016 + Add throwOnFailure to LifecycleBase. Defaults to no change to current behaviour. --- java/org/apache/catalina/util/LifecycleBase.java | 64 ++-- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index 88e18dd..8ea4d65 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -53,6 +53,37 @@ public abstract class LifecycleBase implements Lifecycle { private volatile LifecycleState state = LifecycleState.NEW; +private boolean throwOnFailure = true; + + +/** + * Will a {@link LifecycleException} thrown by a sub-class during + * {@link #initInternal()}, {@link #startInternal()}, + * {@link #stopInternal()} or {@link #destroyInternal()} be re-thrown for + * the caller to handle or will it be logged instead? + * + * @return {@code true} if the exception will be re-thrown, otherwise + * {@code false} + */ +public boolean getThrowOnFailure() { +return throwOnFailure; +} + + +/** + * Configure if a {@link LifecycleException} thrown by a sub-class during + * {@link #initInternal()}, {@link #startInternal()}, + * {@link #stopInternal()} or {@link #destroyInternal()} will be re-thrown + * for the caller to handle or if it will be logged instead. + * + * @param throwOnFailure {@code true} if the exception should be re-thrown, + * otherwise {@code false} + */ +public void setThrowOnFailure(boolean throwOnFailure) { +this.throwOnFailure = throwOnFailure; +} + + /** * {@inheritDoc} */ @@ -105,10 +136,7 @@ public abstract class LifecycleBase implements Lifecycle { initInternal(); setStateInternal(LifecycleState.INITIALIZED, null, false); } catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException( -sm.getString("lifecycleBase.initFail",toString()), t); +handleSubClassException(t, "lifecycleBase.initFail", toString()); } } @@ -167,9 +195,7 @@ public abstract class LifecycleBase implements Lifecycle { } catch (Throwable t) { // This is an 'uncontrolled' failure so put the component into the // FAILED state and throw an exception. -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException(sm.getString("lifecycleBase.startFail", toString()), t); +handleSubClassException(t, "lifecycleBase.startFail", toString()); } } @@ -238,9 +264,7 @@ public abstract class LifecycleBase implements Lifecycle { setStateInternal(LifecycleState.STOPPED, null, false); } catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException(sm.getString("lifecycleBase.stopFail",toString()), t); +handleSubClassException(t, "lifecycleBase.stopFail", toString()); } finally { if (this instanceof Lifecycle.SingleUse) { // Complete stop process first @@ -297,10 +321,7 @@ public abstract class LifecycleBase implements Lifecycle { destroyInternal(); setStateInternal(LifecycleState.DESTROYED, null, false); } catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException( -sm.getString("lifecycleBase.destroyFail",toString()), t); +handleSubClassException(t, "lifecycleBase.destroyFail", toString()); } } @@ -408,4 +429,19 @@ public abstract class LifecycleBase implements Lifecycle { String msg = sm.getString("lifecycleBase.invalidTransition", type, toString(), state); throw new LifecycleException(msg); } + + +private void handleSubClassException(Throwable t, String key, Object... args) throws LifecycleException { +ExceptionUtils.handleThrowable(t); +setStateInternal(LifecycleState.FAILED, null, false); +String msg = sm.getString(key, args); +if (getThrowOnFailure()) { +if (!(t instanceof LifecycleException)) { +t = new LifecycleException(msg, t); +} +throw (LifecycleExce
[tomcat] 01/02: Align with 9.0.x. Spacing, Javadoc
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 d817d1e72afc4a90e916dbf7ffd58a736077a653 Author: Mark Thomas AuthorDate: Thu Sep 26 22:31:49 2019 +0100 Align with 9.0.x. Spacing, Javadoc --- java/org/apache/catalina/util/LifecycleBase.java | 38 ++-- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index 6ccbdb4..88e18dd 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.catalina.util; import java.util.List; @@ -30,7 +29,6 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.res.StringManager; - /** * Base implementation of the {@link Lifecycle} interface that implements the * state transition rules for {@link Lifecycle#start()} and @@ -115,8 +113,15 @@ public abstract class LifecycleBase implements Lifecycle { } +/** + * Sub-classes implement this method to perform any instance initialisation + * required. + * + * @throws LifecycleException If the initialisation fails + */ protected abstract void initInternal() throws LifecycleException; + /** * {@inheritDoc} */ @@ -268,9 +273,7 @@ public abstract class LifecycleBase implements Lifecycle { } } -if (LifecycleState.DESTROYING.equals(state) || -LifecycleState.DESTROYED.equals(state)) { - +if (LifecycleState.DESTROYING.equals(state) || LifecycleState.DESTROYED.equals(state)) { if (log.isDebugEnabled()) { Exception e = new LifecycleException(); log.debug(sm.getString("lifecycleBase.alreadyDestroyed", toString()), e); @@ -284,10 +287,8 @@ public abstract class LifecycleBase implements Lifecycle { return; } -if (!state.equals(LifecycleState.STOPPED) && -!state.equals(LifecycleState.FAILED) && -!state.equals(LifecycleState.NEW) && -!state.equals(LifecycleState.INITIALIZED)) { +if (!state.equals(LifecycleState.STOPPED) && !state.equals(LifecycleState.FAILED) && +!state.equals(LifecycleState.NEW) && !state.equals(LifecycleState.INITIALIZED)) { invalidTransition(Lifecycle.BEFORE_DESTROY_EVENT); } @@ -304,8 +305,15 @@ public abstract class LifecycleBase implements Lifecycle { } +/** + * Sub-classes implement this method to perform any instance destruction + * required. + * + * @throws LifecycleException If the destruction fails + */ protected abstract void destroyInternal() throws LifecycleException; + /** * {@inheritDoc} */ @@ -333,8 +341,7 @@ public abstract class LifecycleBase implements Lifecycle { * @param state The new state for this component * @throws LifecycleException when attempting to set an invalid state */ -protected synchronized void setState(LifecycleState state) -throws LifecycleException { +protected synchronized void setState(LifecycleState state) throws LifecycleException { setStateInternal(state, null, true); } @@ -354,8 +361,9 @@ public abstract class LifecycleBase implements Lifecycle { setStateInternal(state, data, true); } -private synchronized void setStateInternal(LifecycleState state, -Object data, boolean check) throws LifecycleException { + +private synchronized void setStateInternal(LifecycleState state, Object data, boolean check) +throws LifecycleException { if (log.isDebugEnabled()) { log.debug(sm.getString("lifecycleBase.setState", this, state)); @@ -395,9 +403,9 @@ public abstract class LifecycleBase implements Lifecycle { } } + private void invalidTransition(String type) throws LifecycleException { -String msg = sm.getString("lifecycleBase.invalidTransition", type, -toString(), state); +String msg = sm.getString("lifecycleBase.invalidTransition", type, toString(), state); throw new LifecycleException(msg); } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/04: Align with 8.5.x (and fix Javadoc warnings)
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 2767d569970ce4b9b8eab52040451bc878285683 Author: Mark Thomas AuthorDate: Thu Sep 26 22:25:50 2019 +0100 Align with 8.5.x (and fix Javadoc warnings) --- java/org/apache/catalina/Lifecycle.java | 17 ++--- java/org/apache/catalina/util/LifecycleBase.java | 44 +++- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/java/org/apache/catalina/Lifecycle.java b/java/org/apache/catalina/Lifecycle.java index a2b7f99..3dfd7ea 100644 --- a/java/org/apache/catalina/Lifecycle.java +++ b/java/org/apache/catalina/Lifecycle.java @@ -53,7 +53,7 @@ package org.apache.catalina; * | DESTROYED | * | | * |stop() | - * ---»--»-- + * »-»-- * * Any state can transition to FAILED. * @@ -87,7 +87,7 @@ public interface Lifecycle { /** - * The LifecycleEvent type for the "component after init" event. + * The LifecycleEvent type for the "component before init" event. */ public static final String BEFORE_INIT_EVENT = "before_init"; @@ -182,8 +182,11 @@ public interface Lifecycle { /** - * Get the life cycle listeners associated with this life cycle. If this - * component has no listeners registered, a zero-length array is returned. + * Get the life cycle listeners associated with this life cycle. + * + * @return An array containing the life cycle listeners associated with this + * life cycle. If this component has no listeners registered, a + * zero-length array is returned. */ public LifecycleListener[] findLifecycleListeners(); @@ -296,7 +299,11 @@ public interface Lifecycle { /** * Obtain a textual representation of the current component state. Useful - * for JMX. + * for JMX. The format of this string may vary between point releases and + * should not be relied upon to determine component state. To determine + * component state, use {@link #getState()}. + * + * @return The name of the current component state. */ public String getStateName(); diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index faba205..c9739ca 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.catalina.util; import org.apache.catalina.Lifecycle; @@ -26,7 +25,6 @@ import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.res.StringManager; - /** * Base implementation of the {@link Lifecycle} interface that implements the * state transition rules for {@link Lifecycle#start()} and @@ -110,8 +108,15 @@ public abstract class LifecycleBase implements Lifecycle { } +/** + * Sub-classes implement this method to perform any instance initialisation + * required. + * + * @throws LifecycleException If the initialisation fails + */ protected abstract void initInternal() throws LifecycleException; + /** * {@inheritDoc} */ @@ -175,7 +180,7 @@ public abstract class LifecycleBase implements Lifecycle { * will be called on the failed component but the parent component will * continue to start normally. * - * @throws LifecycleException + * @throws LifecycleException Start error occurred */ protected abstract void startInternal() throws LifecycleException; @@ -246,7 +251,7 @@ public abstract class LifecycleBase implements Lifecycle { * {@link LifecycleState#STOPPING} during the execution of this method. * Changing state will trigger the {@link Lifecycle#STOP_EVENT} event. * - * @throws LifecycleException + * @throws LifecycleException Stop error occurred */ protected abstract void stopInternal() throws LifecycleException; @@ -263,9 +268,7 @@ public abstract class LifecycleBase implements Lifecycle { } } -if (LifecycleState.DESTROYING.equals(state) || -LifecycleState.DESTROYED.equals(state)) { - +if (LifecycleState.DESTROYING.equals(state) || LifecycleState.DESTROYED.equals(state)) { if (log.isDebugEnabled()) { Exception e = new LifecycleException(); log.debug(sm.getString("lifecycleBase.alreadyDestroyed", toString()), e); @@ -279,10 +28
[tomcat] branch 7.0.x updated (5c32af4 -> d0685f9)
This is an automated email from the ASF dual-hosted git repository. markt pushed a change to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git. from 5c32af4 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766 new 06e83a4 Fix Javadoc warnings new 2767d56 Align with 8.5.x (and fix Javadoc warnings) new 247c8c3 Back-port refactoring to remove use of LifecycleSupport new d0685f9 Add throwOnFailure to LifecycleBase. The 4 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/catalina/Lifecycle.java| 17 ++- java/org/apache/catalina/Valve.java| 3 +- java/org/apache/catalina/util/LifecycleBase.java | 133 ++--- .../org/apache/catalina/util/LifecycleSupport.java | 3 + 4 files changed, 109 insertions(+), 47 deletions(-) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 03/04: Back-port refactoring to remove use of LifecycleSupport
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 247c8c32c44f65ce7bf3035541eedb8ffc97d5d0 Author: Mark Thomas AuthorDate: Thu Sep 26 22:41:12 2019 +0100 Back-port refactoring to remove use of LifecycleSupport --- java/org/apache/catalina/util/LifecycleBase.java | 25 +- .../org/apache/catalina/util/LifecycleSupport.java | 3 +++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index c9739ca..6195768 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -16,7 +16,11 @@ */ package org.apache.catalina.util; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + import org.apache.catalina.Lifecycle; +import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleListener; import org.apache.catalina.LifecycleState; @@ -32,17 +36,15 @@ import org.apache.tomcat.util.res.StringManager; */ public abstract class LifecycleBase implements Lifecycle { -private static Log log = LogFactory.getLog(LifecycleBase.class); +private static final Log log = LogFactory.getLog(LifecycleBase.class); -private static StringManager sm = -StringManager.getManager("org.apache.catalina.util"); +private static final StringManager sm = StringManager.getManager(LifecycleBase.class); /** - * Used to handle firing lifecycle events. - * TODO: Consider merging LifecycleSupport into this class. + * The list of registered LifecycleListeners for event notifications. */ -private LifecycleSupport lifecycle = new LifecycleSupport(this); +private final List lifecycleListeners = new CopyOnWriteArrayList(); /** @@ -56,7 +58,7 @@ public abstract class LifecycleBase implements Lifecycle { */ @Override public void addLifecycleListener(LifecycleListener listener) { -lifecycle.addLifecycleListener(listener); +lifecycleListeners.add(listener); } @@ -65,7 +67,7 @@ public abstract class LifecycleBase implements Lifecycle { */ @Override public LifecycleListener[] findLifecycleListeners() { -return lifecycle.findLifecycleListeners(); +return lifecycleListeners.toArray(new LifecycleListener[0]); } @@ -74,7 +76,7 @@ public abstract class LifecycleBase implements Lifecycle { */ @Override public void removeLifecycleListener(LifecycleListener listener) { -lifecycle.removeLifecycleListener(listener); +lifecycleListeners.remove(listener); } @@ -85,7 +87,10 @@ public abstract class LifecycleBase implements Lifecycle { * @param data Data associated with event. */ protected void fireLifecycleEvent(String type, Object data) { -lifecycle.fireLifecycleEvent(type, data); +LifecycleEvent event = new LifecycleEvent(this, type, data); +for (LifecycleListener listener : lifecycleListeners) { +listener.lifecycleEvent(event); +} } diff --git a/java/org/apache/catalina/util/LifecycleSupport.java b/java/org/apache/catalina/util/LifecycleSupport.java index 8dd7409..737c07e 100644 --- a/java/org/apache/catalina/util/LifecycleSupport.java +++ b/java/org/apache/catalina/util/LifecycleSupport.java @@ -29,7 +29,10 @@ import org.apache.catalina.LifecycleListener; * registered LifecycleListeners. * * @author Craig R. McClanahan + * + * @deprecated Unused. This class will be removed in Tomcat 8.5.x. */ +@Deprecated public final class LifecycleSupport { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 01/04: Fix Javadoc warnings
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 06e83a498c213c36323c17d3c0c93d6a2cdfc0fd Author: Mark Thomas AuthorDate: Thu Sep 26 22:25:35 2019 +0100 Fix Javadoc warnings --- java/org/apache/catalina/Valve.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/Valve.java b/java/org/apache/catalina/Valve.java index 89a17a2..911ac74 100644 --- a/java/org/apache/catalina/Valve.java +++ b/java/org/apache/catalina/Valve.java @@ -44,7 +44,7 @@ public interface Valve { //-- Properties /** - * Return descriptive information about this Valve implementation. + * @return descriptive information about this Valve implementation. */ public String getInfo(); @@ -130,6 +130,7 @@ public interface Valve { * * @param request The servlet request to be processed * @param response The servlet response to be created + * @param event The Comet event to be processed * * @exception IOException if an input/output error occurs, or is thrown * by a subsequently invoked Valve, Filter, or Servlet - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 04/04: Add throwOnFailure to LifecycleBase.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit d0685f927186da2e0be56c28371e5207ee09ed20 Author: Mark Thomas AuthorDate: Fri Oct 7 08:54:34 2016 + Add throwOnFailure to LifecycleBase. Defaults to no change to current behaviour. --- java/org/apache/catalina/util/LifecycleBase.java | 64 ++-- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/java/org/apache/catalina/util/LifecycleBase.java b/java/org/apache/catalina/util/LifecycleBase.java index 6195768..4b9bc2a 100644 --- a/java/org/apache/catalina/util/LifecycleBase.java +++ b/java/org/apache/catalina/util/LifecycleBase.java @@ -53,6 +53,37 @@ public abstract class LifecycleBase implements Lifecycle { private volatile LifecycleState state = LifecycleState.NEW; +private boolean throwOnFailure = true; + + +/** + * Will a {@link LifecycleException} thrown by a sub-class during + * {@link #initInternal()}, {@link #startInternal()}, + * {@link #stopInternal()} or {@link #destroyInternal()} be re-thrown for + * the caller to handle or will it be logged instead? + * + * @return {@code true} if the exception will be re-thrown, otherwise + * {@code false} + */ +public boolean getThrowOnFailure() { +return throwOnFailure; +} + + +/** + * Configure if a {@link LifecycleException} thrown by a sub-class during + * {@link #initInternal()}, {@link #startInternal()}, + * {@link #stopInternal()} or {@link #destroyInternal()} will be re-thrown + * for the caller to handle or if it will be logged instead. + * + * @param throwOnFailure {@code true} if the exception should be re-thrown, + * otherwise {@code false} + */ +public void setThrowOnFailure(boolean throwOnFailure) { +this.throwOnFailure = throwOnFailure; +} + + /** * {@inheritDoc} */ @@ -105,10 +136,7 @@ public abstract class LifecycleBase implements Lifecycle { initInternal(); setStateInternal(LifecycleState.INITIALIZED, null, false); } catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException( -sm.getString("lifecycleBase.initFail",toString()), t); +handleSubClassException(t, "lifecycleBase.initFail", toString()); } } @@ -167,9 +195,7 @@ public abstract class LifecycleBase implements Lifecycle { } catch (Throwable t) { // This is an 'uncontrolled' failure so put the component into the // FAILED state and throw an exception. -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException(sm.getString("lifecycleBase.startFail", toString()), t); +handleSubClassException(t, "lifecycleBase.startFail", toString()); } } @@ -238,9 +264,7 @@ public abstract class LifecycleBase implements Lifecycle { setStateInternal(LifecycleState.STOPPED, null, false); } catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException(sm.getString("lifecycleBase.stopFail",toString()), t); +handleSubClassException(t, "lifecycleBase.stopFail", toString()); } finally { if (this instanceof Lifecycle.SingleUse) { // Complete stop process first @@ -297,10 +321,7 @@ public abstract class LifecycleBase implements Lifecycle { destroyInternal(); setStateInternal(LifecycleState.DESTROYED, null, false); } catch (Throwable t) { -ExceptionUtils.handleThrowable(t); -setStateInternal(LifecycleState.FAILED, null, false); -throw new LifecycleException( -sm.getString("lifecycleBase.destroyFail",toString()), t); +handleSubClassException(t, "lifecycleBase.destroyFail", toString()); } } @@ -408,4 +429,19 @@ public abstract class LifecycleBase implements Lifecycle { String msg = sm.getString("lifecycleBase.invalidTransition", type, toString(), state); throw new LifecycleException(msg); } + + +private void handleSubClassException(Throwable t, String key, Object... args) throws LifecycleException { +ExceptionUtils.handleThrowable(t); +setStateInternal(LifecycleState.FAILED, null, false); +String msg = sm.getString(key, args); +if (getThrowOnFailure()) { +if (!(t instanceof LifecycleException)) { +t = new LifecycleException(msg, t); +} +throw (LifecycleExce
buildbot failure in on tomcat-7-trunk
The Buildbot has detected a new failure on builder tomcat-7-trunk while building tomcat. Full details are available at: https://ci.apache.org/builders/tomcat-7-trunk/builds/1465 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: asf946_ubuntu Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-7-commit' triggered this build Build Source Stamp: [branch 7.0.x] d0685f927186da2e0be56c28371e5207ee09ed20 Blamelist: Mark Thomas BUILD FAILED: failed compile_1 Sincerely, -The Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] davoustp commented on issue #170: Connections validated without explicit validation query leave a transaction open
davoustp commented on issue #170: Connections validated without explicit validation query leave a transaction open URL: https://github.com/apache/tomcat/pull/170#issuecomment-535816682 Hi, any idea if and when this fix will be merged into a Tomcat release? Thx This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org