пт, 28 апр. 2023 г. в 16:21, Konstantin Kolinko <knst.koli...@gmail.com>:
>
> чт, 27 апр. 2023 г. в 19:34, Mark Thomas <ma...@apache.org>:
> >
> > Hi all,
> >
> > As part of a discussion around a Spring Boot issue [1], the question has
> > been raised whether there is merit in moving the Utility executor
> > start/stop from StandardServer init/destroy to start/stop.
> >
> > I've looked at the code and I don't see any uses of the Executor until
> > sub-components are in the start phase (there is a little copying of
> > references that might need to move) so I think the change is doable.
> >
> > The main advantage is that in the embedded scenario where there might be
> > a long series of start / stop / start / stop etc, shutting down the
> > executor on stop should avoid issues where executor tasks are not
> > shutdown correctly. My brief code review suggested that Tomcat does this
> > correctly but the executor is also exposed to application code.
> >
> > Thoughts?
> >
> > Mark
> >
> > [1] https://github.com/spring-projects/spring-boot/issues/34955
>
> +1.
>
> It sounds reasonable, and thinking about Tomcat being started by
> Commons Daemon jsvc, I think that init() should not be used to start
> utility threads.
>
> If it causes a regression (I mean, if something really needs to be
> done at init() time), one may implement a Listener.

Looking at when a Connector starts its pool of threads,

o.a.c.connector.Connector.initInternal() does

        // Initialize adapter
        adapter = new CoyoteAdapter(this);
        protocolHandler.setAdapter(adapter);
        if (service != null) {
            
protocolHandler.setUtilityExecutor(service.getServer().getUtilityExecutor());
        }

So it also needs a change.

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