On Fri, Nov 23, 2018 at 1:05 PM Mark Thomas <ma...@apache.org> wrote:
> On 08/11/2018 10:17, r...@apache.org wrote: > > Author: remm > > Date: Thu Nov 8 10:17:43 2018 > > New Revision: 1846116 > > > > URL: http://svn.apache.org/viewvc?rev=1846116&view=rev > > Log: > > Add a scheduled executor service to the Service, which can be used to > process utility tasks including periodic ones. > > Add a simple wrapper to prevent random lifecycle and configuration > operations. > > Add a bean for it. > > <snip/> > > > Modified: tomcat/trunk/java/org/apache/catalina/core/StandardService.java > > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardService.java?rev=1846116&r1=1846115&r2=1846116&view=diff > > <snip/> > > > + private synchronized void reconfigureUtilityExecutor(int threads) { > > + if (utilityExecutor != null) { > > + utilityExecutor.setMaximumPoolSize(threads); > > I'm seeing a SpotBugs warning on the above line that calling > setMaximumPoolSize() is a NO-OP. From the Javadoc: > > <quote> > In particular, because it acts as a fixed-sized pool using {@code > corePoolSize} threads and an unbounded queue, adjustments to {@code > maximumPoolSize} have no useful effect. > </quote> > > Should this be calling setCorePoolSize() ? > Ok, I will make adjustments then. Another bad idea as well: using allowCoreThreadTimeOut, all is does is endlessly stopping and restarting immediately the core threads. Rémy