8 Replies Latest reply on Jan 15, 2019 8:18 AM by valsaraj007

    WildFly hangs after asynchronous servlet response

    valsaraj007

      I have checked this asynchronous servlet sample in WildFly:https://github.com/wildfly/quickstart/blob/master/servlet-async/src/main/java/org/jboss/as/quickstarts/servlet/async/AsynchronousServlet.java

      This worked fine but after processing async call, all subsequent calls hanged.

      Any idea about what could be the problem?

        • 1. Re: WildFly hangs after asynchronous servlet response
          pferraro

          Is the containing web application distributable?

          • 2. Re: WildFly hangs after asynchronous servlet response
            valsaraj007

            Yes, this is distributable.

            • 3. Re: WildFly hangs after asynchronous servlet response
              pferraro

              Disable batching in your Infinispan cache within the "web" cache container.

              e.g. <transaction mode="NONE"/>

              1 of 1 people found this helpful
              • 4. Re: WildFly hangs after asynchronous servlet response
                valsaraj007

                Thanks Paul!

                 

                This is current conf:

                <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">

                                    <transport lock-timeout="120000"/>

                                    <distributed-cache name="dist" batching="true" mode="ASYNC" owners="2" l1-lifespan="0">

                                        <locking isolation="REPEATABLE_READ" acquire-timeout="360000" concurrency-level="1000"/>

                                        <file-store/>

                                    </distributed-cache>

                </cache-container>

                 

                pferraro

                Here transaction  is disabled. So it should work, right?

                Also batching="true"  what for this used?

                • 5. Re: WildFly hangs after asynchronous servlet response
                  pferraro

                  Actually, no - transactions will not be disabled in that configuration.

                  batching="true" was deprecated many release ago, and translates to <transaction mode="BATCH"/>.

                  Remove this attribute and you should be all set.

                   

                  Additionally, mode="ASYNC" was also deprecated while ago as well - and will be ignored.

                  • 6. Re: WildFly hangs after asynchronous servlet response
                    valsaraj007

                    pferraro

                    thanks!

                     

                    I tried but got this error when applied in WildFly-8.2.1  on startup:

                    [Server: node-00]       service jboss.clustering.registry.web.default: org.jboss.msc.service.StartException in service jboss.clustering.registry.web.default: org.infinispan.commons.CacheConfigurationException: Invocation batching not enabled in current configuration! Please enable it.

                    Here is the conf:

                    <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">

                                        <transport lock-timeout="120000"/>

                                        <distributed-cache name="dist" mode="ASYNC" owners="2" l1-lifespan="0">

                                            <locking isolation="REPEATABLE_READ" acquire-timeout="360000"/>

                                            <file-store/>

                                            <transaction mode="NONE"/>

                                        </distributed-cache>

                    </cache-container>

                    Above exception fixed when I added back batching="true".

                    <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">

                                        <transport lock-timeout="120000"/>

                                        <distributed-cache name="dist" batching="true" mode="ASYNC" owners="1" l1-lifespan="0">

                                            <locking isolation="REPEATABLE_READ" acquire-timeout="360000"/>

                                            <transaction mode="NONE"/>

                                            <file-store/>

                                        </distributed-cache>

                      </cache-container>

                    But still  async servlet not working!

                    What for we need following conf:

                    <locking isolation="REPEATABLE_READ" acquire-timeout="360000"/>

                    • 7. Re: WildFly hangs after asynchronous servlet response
                      pferraro

                      Sorry - I had no idea you were using such an old release (the latest release is WildFly 15!).

                       

                      The deprecations I mentioned earlier occurred in WF10, IIRC.  Try lowering your locking isolation to READ_COMMITTED (that should be the default).

                       

                      Otherwise, I suggest using a more recent release - as we have since made a number of fixes to improve the behavior of asynchronous contexts with distributable web applications.

                      • 8. Re: WildFly hangs after asynchronous servlet response
                        valsaraj007

                        pferraro

                        This issue fixed in 8.2 when the following conf change applied:

                        <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">

                                            <transport lock-timeout="120000"/>

                                            <distributed-cache name="dist" batching="true" mode="ASYNC" owners="2" l1-lifespan="0">

                                                <locking isolation="READ_COMMITTED" acquire-timeout="360000"/>

                                                <transaction locking="OPTIMISTIC"/>

                                                <file-store/>

                                            </distributed-cache>

                        </cache-container>

                        1 of 1 people found this helpful