1 Reply Latest reply on Sep 27, 2012 12:47 PM by alexmd

    Strange slowdown of Errai in Firefox

    alexmd

      In the Errai snapshot I downloaded on 2011-08-12 I discovered a strange slowdown of the Errai bus that occurs in Firefox 5. Here is my configuration:

       

      I use Errai 1.3.0 snapshot as mentioned above with GWT 2.3 and SmartGWT Pro 2.4. I configured Errai to use the SimpleDispatcher. The problem occurs in Hosted Mode as well as in Web Mode (which runs on a Tomcat 6.0.24-2ubuntu1.7):

       

      In my application I perform some RPCs and message sendings subsequently. This works fine and with good performance - for a while. Some RPCs start an operation that runs for a while. During its run it sends messages to the client (which has a subscription for them) providing progress information. These messages arrive very fast. Via the server log I can observe that debug output of the operation started by the RPC and progress bar match.

       

      In one of the table views my application provides it is possible to export table data to Excel. This is realized using SmartGWT and causes a file download operation. After successful download the further work with the application is very slow if operations use the Errai bus.

       

      Here are some details for my observations:

       

      • If the download operation starts, Errai writes an exception to the log (in Hosted Mode it is written to the client output log):

      15:57:05.235 [ERROR] [dataviewer] (ClientMessageBusImpl.java:974) 2011-08-22 15:57:05,235 [ERROR] Communication Error<br/>Additional details:<br/> None

      java.lang.Throwable: null

          at org.jboss.errai.bus.client.framework.ClientMessageBusImpl$LongPollRequestCallback.onResponseReceived(ClientMessageBusImpl.java:974)

          at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)

          at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)

          at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)

          at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)

          at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)

          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)

          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)

          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)

          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)

          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)

          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)

          at com.google.gwt.core.client.impl.Impl.apply(Impl.java)

          at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)

          at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)

          at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)

          at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)

          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)

          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)

          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)

          at java.lang.Thread.run(Unknown Source)

      • As I read in a SmartGWT forum the download operation normally causes a Window Close Event sent by the browser. It seems that this is true because if I implement and register an onWindowClosing() callback, it is invoked during the download operation. I assume that this causes the exception. I get this exception too if I reload the whole page of the GWT application in the browser.
      • As far as I can see in the Errai Bus Monitor no message subscription is open when the exception occurs.
      • After download (and occurrence of the exception) the debug output of operation in the server log and message arrival in the client (visualized by the progress bar) does not match anymore. The operation runs and finishes as fast as usual (and sends its progress messages via Errai bus) but my GWT client receives these messages very very slowly. The operation seems to last at least twice the time as before.
      • This behavior cannot be observed in Internet Explorer 8.
      • This behavior and the exception mentioned above cannot be observed if the download is redirected to a new window or Firefox tab. In this case the Window Close Event is not sent, the exception is not thrown and the Errai bus works as fast as before.

       

      Has anyone observed this or a similar problem too? Or has a solution? At the moment, I have no other solution (or workaround) as to redirect the download to a new window.

       

      Greetings,

      Alexander.