tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r952000 - /tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
Date Mon, 07 Jun 2010 04:11:14 GMT
2010/6/7  <markt@apache.org>:
> Author: markt
> Date: Sun Jun  6 21:50:11 2010
> New Revision: 952000
>
> URL: http://svn.apache.org/viewvc?rev=952000&view=rev
> Log:
> Make syncs consistent
> Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=49372
> Avoid invalid Lifecycle transitions on failed start due to already bound shutdown port
>
> Modified:
>    tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java
>

> +++ tomcat/trunk/java/org/apache/catalina/util/LifecycleBase.java Sun Jun  6 21:50:11
2010
> @@ -134,7 +134,12 @@ public abstract class LifecycleBase impl
>
>         setState(LifecycleState.STARTING_PREP);
>
> -        startInternal();
> +        try {
> +            startInternal();
> +        } catch (LifecycleException e) {
> +            setState(LifecycleState.FAILED);
> +            throw e;
> +        }
>
>         if (state.equals(LifecycleState.FAILED) ||
>                 state.equals(LifecycleState.MUST_STOP)) {

Probably RuntimeException and Error should also move it into the
FAILED state? E.g.

boolean startDone = false;
try {
  startInternal();
  startDone = true;
} finally {
  if (!startDone) {
    setState(LifecycleState.FAILED);
  }
}

Best regards,
Konstantin Kolinko

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


Mime
View raw message