Push errors on UI detach

Tickets
14251
and
14280
show Leif Astrand hard at work looking for the cause of an Atmosphere error generated when a UI detaches. In case it helps, a bit of log data.

I receive a handful of these each day. Some UIs detach without generating the error. There is no impact on the user. I’m using Chrome rather than Firefox and not using @PreserveOnRefresh.

Vaadin 7.2.6, Tomcat 8.0.9, Java 8u11, latest Chrome, manual push.

Aug 02, 2014 11:48:41 AM com.vaadin.server.communication.PushHandler onThrowable
SEVERE: Exception in push connection
java.io.IOException: AtmosphereResource Cancelled: 08ea4dd0-deda-4f93-8b48-3dd968118582
    at org.atmosphere.cpr.AtmosphereResponse.validAsyncIOWriter(AtmosphereResponse.java:459)
    at org.atmosphere.cpr.AtmosphereResponse.access$1100(AtmosphereResponse.java:55)
    at org.atmosphere.cpr.AtmosphereResponse$2.write(AtmosphereResponse.java:499)
    at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:141)
    at com.vaadin.server.communication.PushHandler$1.onStateChange(PushHandler.java:63)
    at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1018)
    at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1038)
    at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:879)
    at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:520)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Aug 02, 2014 11:48:41 AM com.vaadin.server.communication.PushHandler disconnect
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.

Aug 02, 2014 1:12:43 PM com.vaadin.server.communication.PushHandler onThrowable
SEVERE: Exception in push connection
java.io.IOException: AtmosphereResource Cancelled: 83412983-9c02-4903-a4c8-22cecd7d5791
    at org.atmosphere.cpr.AtmosphereResponse.validAsyncIOWriter(AtmosphereResponse.java:459)
    at org.atmosphere.cpr.AtmosphereResponse.access$1100(AtmosphereResponse.java:55)
    at org.atmosphere.cpr.AtmosphereResponse$2.write(AtmosphereResponse.java:499)
    at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:141)
    at com.vaadin.server.communication.PushHandler$1.onStateChange(PushHandler.java:63)
    at org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(DefaultBroadcaster.java:1018)
    at org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(DefaultBroadcaster.java:1038)
    at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:879)
    at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:520)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Aug 02, 2014 1:12:44 PM com.vaadin.server.communication.PushHandler disconnect
SEVERE: Could not get UI. This should never happen, except when reloading in Firefox - see http://dev.vaadin.com/ticket/14251.

Same problem for me. I’m using @PreserveOnRefresh.

I also get the ERROR log:

[#|2014-09-15T19:35:40.201+0200|SEVERE|glassfish3.1.2|com.vaadin.server.communication.PushHandler|_ThreadID=36;_ThreadName=Thread-2;|Session expired before push was disconnected. This should never happen
com.vaadin.server.SessionExpiredException
at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:655)
at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:518)
at com.vaadin.server.communication.PushHandler.disconnect(PushHandler.java:351)
at com.vaadin.server.communication.PushHandler.access$000(PushHandler.java:56)
at com.vaadin.server.communication.PushHandler$1.onStateChange(PushHandler.java:65)
at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:468)
at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:420)
at org.atmosphere.cpr.AsynchronousProcessor.cancelled(AsynchronousProcessor.java:504)
at org.atmosphere.container.Servlet30CometSupport.cancelled(Servlet30CometSupport.java:137)
at org.atmosphere.cpr.AsynchronousProcessor$AsynchronousProcessorHook.closed(AsynchronousProcessor.java:534)
at org.atmosphere.websocket.DefaultWebSocketProcessor.executeClose(DefaultWebSocketProcessor.java:525)
at org.atmosphere.websocket.DefaultWebSocketProcessor$3.call(DefaultWebSocketProcessor.java:485)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
|#]

not in sequence with the above messages.

I’ve migrated to Vaadin 7.2.7 in order to resolve the com.vaadin.server.SessionExpiredException problem but it still persist, not as often as before though.

Hi,
I have the same issue and haven’t found any solution yet.
Have anybody solved it?
Thanks in advance,
Alex

It looks like Tomcat 8.0.20 has solved this. Vaadin 7.4.0.