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

Async service with EJB pool blocks threads not used

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 8.2.0.Final
    • EJB
    • None

      I've created a bean pool to limit the number of some instances. In that case maximum 5 instances.

      <pools>
      <bean-instance-pools>
      <strict-max-pool name="slsb-max5" max-pool-size="5" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      ...
      </bean-instance-pools>
      </pools>

      The idea was to have some async service that work simultaneous.

      @Stateless
      @Pool("slsb-max5")
      public class AsyncService {
      @Asynchronous
      public Future<LocalDateTime> async2Seconds()

      { //some parallel work... }

      }

      The problem is when I invoke simultaneous more than 5 times it blocks the threads even it is not using (async thread-pool-name="default", default=10)

      Attached an example project (configure slsb-max5 pool and access /test-thread-pool/rest/async-resource)

            Unassigned Unassigned
            janarioliver@gmail.com Janario Oliveira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: