Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-6540

Batch thread pool keepAlive setting seems to be ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 10.0.0.Final
    • Batch
    • None
    • Hide
      Show
      get e.g. decision sample from https://github.com/javaee-samples/javaee7-samples/tree/master/batch start WildFly run the test with remote wildfly arqullian adapter: mvn clean test -Pwildfly-remote-arquillian inspect the live threads - the threads for Batch should start with " Batch Thread "

      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:

      <thread-pool name="batch">
          <max-threads count="10"/>
          <keepalive-time time="30" unit="seconds"/>
      </thread-pool>
      

      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:

      public void setAllowCoreThreadTimeout(final boolean allow) {
              setAllowCoreThreadTimeout(allow);
      }
      

      should be replaced with:

      public void setAllowCoreThreadTimeout(final boolean allow) {
              allowCoreThreadTimeOut(allow);
      }
      

      Given that JBossThreadPoolExecutor is used by more subsystems this issue may affect other subsystems as well.

              jperkins-rhn James Perkins
              mkouba@redhat.com Martin Kouba
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: