5 Replies Latest reply on Aug 29, 2013 2:36 PM by csa

    slow CDI global messaging since upgrade to 2.4.0.CR1

    michael_jank

      Hi,

       

      since upgrading from errai 2.3 to 2.4.0.CR1 I encounter slow global messaging using CDI. It was very responsive before. Conversational messages work fine.

       

      Problem occurs if a user triggers an action which fires a global message on the server. On the same client the message appears fast, but on other clients than of this user the time is fluctuating, it takes a few seconds to up to a minute to receive this message.

       

      This seems to be independent of the browser. I use tomcat 7.0.42.

      Are there any known issues concerning this?

        • 1. Re: slow CDI global messaging since upgrade to 2.4.0.CR1
          csa

          Hi Michael,

           

          No, this is the first time we hear about this. In fact, I can't currently reproduce the problem you're describing in our tests and demos.

           

          What ErraiServlet implementation are you using (DefaultBlocking or StandardAsync)?

           

          Can you reproduce the problem using multiple sessions on one machine (e.g. open multiple browsers locally to simulate multiple clients)?

           

          Do you see any errors in your browser's console?

           

          Thanks,

          Christian

          • 2. Re: slow CDI global messaging since upgrade to 2.4.0.CR1
            michael_jank

            Hi Christian,

             

            Yes, I can reproduce it using multiple browsers on my local machine.

             

            I am using StandardAsyncServlet and long polling. No errors in the browsers console, but the (slow) events seem to correspond with a stacktrace on the tomcat:

                 WARNING: onComplete() failed for listener of type [org.apache.catalina.core.AsyncListenerWrapper]

                 java.lang.IllegalStateException: Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

                    at org.apache.coyote.AsyncStateMachine.asyncComplete(AsyncStateMachine.java:223)

                    at org.apache.coyote.http11.Http11Processor.actionInternal(Http11Processor.java:358)

                    at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:851)

                    at org.apache.coyote.Request.action(Request.java:344)

                    at org.apache.catalina.core.AsyncContextImpl.complete(AsyncContextImpl.java:92)

                    at org.jboss.errai.bus.server.servlet.StandardAsyncServlet$1.onComplete(StandardAsyncServlet.java:80)

                    at org.apache.catalina.core.AsyncListenerWrapper.fireOnComplete(AsyncListenerWrapper.java:40)

                    ...

             

            In fact I just realized that the events come immediately when using websockets instead.

             

            Thanks for your help,

            Michael

            • 3. Re: slow CDI global messaging since upgrade to 2.4.0.CR1
              csa

              Hi Michael,

               

              Excellent! That really helps. All our demos use the DefaultBlockingServlet. Don't let the word "blocking" stop you from using it . It doesn't mean it's slower for your use cases. We would need to measure that.

               

              The real difference is that with the AsyncServlet a high number of incoming requests under high load should consume less threads on the server. That might not be an issue for you at all.

               

              We will look into the problem with the StandardAsyncServlet.

               

              Thanks,

              Christian

              • 4. Re: slow CDI global messaging since upgrade to 2.4.0.CR1
                michael_jank

                Hi Christian,

                 

                yes, I just tested it with my application, with DefaultBlockingServlet it works fine.

                 

                Thanks for your quick responses,

                Michael

                • 5. Re: slow CDI global messaging since upgrade to 2.4.0.CR1
                  csa

                  The problems with our StandardAsyncServlet should be fixed now as well:

                  [#ERRAI-614] StandardAsyncServlet causes delayed delivery of broadcast CDI events - JBoss Issue Tracker