1 Reply Latest reply on May 11, 2017 2:40 PM by Max Barkley

    Errai Bus starts looping on client side

    Saif Rehman Newbie

      Hello,

      We have been using Errai 3.2.5 Final for our Web Application. We have seen strange behavior of Errai Bus on client side (Browser Console) while using the application where Errai bus sending a request every 100-200 ms and getting an empty HTTP 200 OK response from the server and then requesting again. (During all this , the application is in idle state and not being used)  And this keeps happening until we navigate away from the Page or refresh the page. I have attached a Screen shot for the reference.

      image-2017-05-09-17-11-01-252.png

       

      A request is being made almost every 80 ms and getting a response 200 in above snap.

      This starts happening while using the application (in almost all of the application pages). There are no specific steps to reproduce this issue but we see it happening quite frequently when the application is in idle state

       

      Following is ErraiService.properties :

       

      errai.dispatcher_implementation=org.jboss.errai.bus.server.SimpleDispatcher

      errai.async.thread_pool_size=5

      errai.bus.buffer_size=96

      errai.authentication_adapter=org.jboss.errai.bus.server.security.auth.JAASAdapter

      errai.require_authentication_for_all=true

      errai.login_motd=UNAUTHORIZED ACCESS IS PROHIBITED!

       

      web.xml

       

      <servlet>

        <servlet-name>ErraiServlet</servlet-name>

        <servlet-class>org.jboss.errai.bus.server.servlet.StandardAsyncServlet</servlet-class>

        <load-on-startup>1</load-on-startup>

        <async-supported>true</async-supported>

      </servlet>

        

      <servlet-mapping>

        <servlet-name>ErraiServlet</servlet-name>

        <url-pattern>*.erraiBus</url-pattern>

      </servlet-mapping>

       

      can you please help us to determine the real issue here ?

        • 1. Re: Errai Bus starts looping on client side
          Max Barkley Expert

          Hi Saif,

           

          This looks like a potential bug in the SSE negotiation logic. URLs of the form "in.<client-id>.erraiBus" are used for SSE connections (where a single SSE connection is meant to be used to deliver all messages from the server bus to a particular client bus).

           

          But SSE is not supported by the StandardAsyncServlet. It should be the case that when the bus connection is negotiated, the client is informed that SSE is not enabled and falls back to long-polling, but evidently something has gone wrong where the client attempts an SSE connection and continually attempts to reopen it.

           

          I encourage you open a JIRA issue with more details (including browser logs of the entire bus connection in a failing case). In the mean time, here are some workarounds you can try:

           

          • Use the DefaultBlockingServlet (which supports SSE)
          • Explicitly disable SSE support in your ErraiService.properties with the property: "errai.bus.enable_sse_support=false"

           

          Cheers.