Le mer. 13 janv. 2021 à 15:42, Konstantin Kolinko <knst.koli...@gmail.com>
a écrit :

> Hi!
>
> ср, 13 янв. 2021 г. в 17:04, Romain Manni-Bucau <rmannibu...@gmail.com>:
> >
> > Drafted https://github.com/apache/tomcat/pull/400 in regards of that
> topic.
> >
>
> Looks good thus far.
> Several notes:
>
> 1. Maybe others disagree, but I am OK with the default for
> "exitOnFirstListenerFailure" property being changed to "true".
>
> It is a rare use case, and I think that it is safe to fail early. The
> web application will fail to start anyway.
>

Any (easy) way to rerun the TCK to validate this does not break anything
before?


>
> 2. A better name?
>
> I do not like "exit**", because Tomcat does not exit here. It does not
> call "System.exit()" or anything like that. It is just a single web
> application that fails to start.
>
> Maybe something like "abortOnFirstListenerFailure".
>
> (There is org.apache.catalina.startup.EXIT_ON_INIT_FAILURE system
> property that really forces Tomcat as a whole to shut down. Thus
> "exit" is used in its name.)
>

We can also reverse it like "alwaysInitializeAllContextListeners", can be a
way to make it more explicit.


>
> 3. The attribute has to be added to the JMX configuration file,
> java/org/apache/catalina/core/mbeans-descriptors.xml
>

Will do once we all agree on a name.


>
> 4. The attribute has to be documented in the Configuration Reference,
> webapps/docs/config/context.xml
>

The same I guess ;).


>
> 5. Looking for other similar listeners and callbacks.
>
> E.g. ServletContainerInitializers
>
>             for (Map.Entry<ServletContainerInitializer, Set<Class<?>>>
> entry :
>                 initializers.entrySet()) {
>                 try {
>                     entry.getKey().onStartup(entry.getValue(),
>                             getServletContext());
>                 } catch (ServletException e) {
>                     log.error(sm.getString("standardContext.sciFail"), e);
>                     ok = false;
>                     break;
>                 }
>             }
>

There is already a break there so no need of any update I guess?


>
> Looking at implementations of org.apache.catalina.LifecycleListener -
> they are OK.
> (Those listeners are called notified via
> "org.apache.catalina.util.LifecycleBase.fireLifecycleEvent()". That
> method does not catch exceptions and thus fails early.)
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

Reply via email to