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

EJB Access Timeout is ignored on SFSBs when using distributed caches

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 11.0.0.CR1
    • EJB
    • None

      When using distributed caches on Stateful Session Beans, the configured access timeout is ignored. However, the caches acquire-timeout is used instead, leading to a "org.infinispan.util.concurrent.TimeoutException: ISPN000299: Unable to acquire lock after x seconds".

      The configuration:

      <session-bean>
      	<stateless>
      		<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
      	</stateless>
      	<stateful default-access-timeout="2000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>
      	<singleton default-access-timeout="2000"/>
      </session-bean>
      <pools>
      	<bean-instance-pools>
      		<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      		<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
      	</bean-instance-pools>
      </pools>
      <caches>
      	<cache name="simple"/>
      	<cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
      </caches>
      ...
      <subsystem xmlns="urn:jboss:domain:infinispan:4.0">
      ...
      	<cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
      		<local-cache name="passivation">
      			<locking isolation="REPEATABLE_READ" acquire-timeout="10000"/>
      			<transaction mode="BATCH" />
      			<file-store passivation="true" purge="true"/>
      		</local-cache>
      	</cache-container>
      ...
      </subsystem>
      

      With the above configuration, any access to a @Stateful-component does not timeout after 2 seconds, but the 10 seconds configured on the infinispan-cache.

      I have attached a simple JSF web application as an eclipse project to reproduce the problem. The application calls a method on a sfsb, increments a counter and waits for 300ms. If one sends multiple request at the same time (e.g. by pressing F5 repeatedly), the problem can easily be reproduced after a few seconds.

      If the cache-ref is set to "simple" the configured access timeout works as expected, however the access to the stateful bean does not appear to be in sync with the requests the client sent. We came around this issue when trying to migrate vom WF9 to WF10 (see also this forum post: https://developer.jboss.org/thread/266303). When the cache-ref is set to "distrubted", the requests are handled correctly/in correct order (in WF9 this was also the case with cache-ref "simple"), but the access timeout is ignored.

            tadamski@redhat.com Tomasz Adamski
            hablesreiter@adaptive.at Bernhard Hablesreiter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: