On Fri, Sep 18, 2020 at 12:06 PM Mark Thomas <ma...@apache.org> wrote:
> On 18/09/2020 10:40, r...@apache.org wrote: > > This is an automated email from the ASF dual-hosted git repository. > > > > remm 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 27bb36b Use utility executor for scanning > > 27bb36b is described below > > > > commit 27bb36bdaa56d62fdcc28d3b8e3d4c25f4a44a50 > > Author: remm <r...@apache.org> > > AuthorDate: Fri Sep 18 11:40:17 2020 +0200 > > > > Use utility executor for scanning > > > > PR354 submitted by Jatin Kamnani. > > The flag in on the context, as that's where it belongs. Defaults to > > false, can be configured through the context defaults or per context. > > <snip/> > > > + protected void processAnnotationsInParallel(Set<WebXml> fragments, > boolean handlesTypesOnly, > > + Map<String, > JavaClassCacheEntry> javaClassCache) { > > + Server s = getServer(); > > + ExecutorService pool = null; > > + try { > > + pool = s.getUtilityExecutor(); > > + List<Future<?>> futures = new ArrayList<>(fragments.size()); > > + for (WebXml fragment : fragments) { > > + Runnable task = new AnnotationScanTask(fragment, > handlesTypesOnly, javaClassCache); > > + futures.add(pool.submit(task)); > > + } > > + try { > > + for (Future<?> future : futures) { > > + future.get(); > > + } > > + } catch (Exception e) { > > + throw new > RuntimeException(sm.getString("contextConfig.processAnnotationsInParallelFailure"), > e); > > + } > > + } finally { > > + if (pool != null) { > > + pool.shutdownNow(); > > + } > > } > > } > > Why is the executor being shutdown here? What about other Tomcat > components that might be using it or want to use it in the future? > I forgot to remove that. It does nothing since there's a facade for the executor which does a noop there. Rémy