[jboss-jira] [JBoss JIRA] (WFLY-6540) Batch thread pool keepAlive setting seems to be ignored
Martin Kouba (JIRA)
issues at jboss.org
Mon Apr 25 03:58:00 EDT 2016
[ https://issues.jboss.org/browse/WFLY-6540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196244#comment-13196244 ]
Martin Kouba commented on WFLY-6540:
------------------------------------
bq. I've sent a PR to fix the bug in jboss-threads...
Thanks!
bq. This is fairly common behavior for thread pools...
Yes, but the thread pool used by batch subsystem is using a fixed number of threads, right?
bq. Maybe in some ways it doesn't make sense to allow the keep-alive timeout to be configured in unbounded queues...
Yes, this should be clarified. For me the {{UnboundedQueueThreadPoolService}} is a WFLY variant of {{java.util.concurrent.Executors.newFixedThreadPool(int)}}.
> Batch thread pool keepAlive setting seems to be ignored
> -------------------------------------------------------
>
> Key: WFLY-6540
> URL: https://issues.jboss.org/browse/WFLY-6540
> Project: WildFly
> Issue Type: Bug
> Components: Batch
> Affects Versions: 10.0.0.Final
> Reporter: Martin Kouba
> Assignee: James Perkins
>
> Maybe I'm missing something but although the default _keepAlive_ is set to 30 seconds, the threads seem to run indefinitely - see also steps to reproduce.
> Snippet from the default config file:
> {code}
> <thread-pool name="batch">
> <max-threads count="10"/>
> <keepalive-time time="30" unit="seconds"/>
> </thread-pool>
> {code}
> Anyway, the {{UnboundedQueueThreadPoolService}}, or the underlying {{JBossThreadPoolExecutor}} respectively, used by the Batch subsystem is using the same {{corePoolSize}} and {{maximumPoolSize}} and it seems the core threads are not allowed to time out, i.e. {{org.jboss.threads.JBossThreadPoolExecutor.setAllowCoreThreadTimeout(boolean)}} is not used.
> Moreover, a {{JBossThreadPoolExecutor.setAllowCoreThreadTimeout(boolean)}} invocation would probably result in an infinite loop:
> {code}
> public void setAllowCoreThreadTimeout(final boolean allow) {
> setAllowCoreThreadTimeout(allow);
> }
> {code}
> should be replaced with:
> {code}
> public void setAllowCoreThreadTimeout(final boolean allow) {
> allowCoreThreadTimeOut(allow);
> }
> {code}
> Given that {{JBossThreadPoolExecutor}} is used by more subsystems this issue may affect other subsystems as well.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list