PUSH under 7.1.2 and Tomcat BIO/NIO connectors

We’re having trouble reproducing some issues we’ve found since upgrading to 7.1.2 and enabling PUSH (added to our SERVLET config:

  <init-param>
    	<param-name>pushmode</param-name>
    	<param-value>automatic</param-value>
 </init-param>
<async-supported>true</async-supported> <!-- Enable if using PUSH -->

We are running Tomcat 7.0.29 and Tomcat 7.0.32 on Java 7.0.25. We are not sure, but we have seen exceptions about running out of memory (SEVERE:Memory usage is low, parachute is non existent, your system may start failing) since upgrading to 7.1.2 and enabling PUSH.

We converted our Tomcat to use BIO instead NIO for our SSL connectors, and the problem went away. With the NIO connectors, we noted lots of these messages, too:

WARNING: Request is not longer valid 58c5c84a-4178-4987-92a3-c2b3f0dd4739

But with BIO, we don’t see the issues, and will see the above WARNING only rarely, like when a user logs off.

We’re trying to track this down, but are there known issues or configuration that we should ensure are right? Thanks!

Do you mean upgrading from 7.0.x to 7.1.2? Or from an earlier 7.1 release? One thing I’d try is testing with the latest Tomcat version; at least the 7.0.2x series has had all kinds of random issues with Websockets. We’ve been seeing the “request no longer valid” warning intermittently as well - should try to figure out what exactly is causing it.

Thanks, Johannes. Yes, we upgraded from 7.0.7 to 7.1.2.

It does seem like our upgrade from Tomcat 7.0.29 and 7.0.32 to the latest 7.0.42 has resolved the issue for now. We are back on the NIO connectors and it seems to be working. We’ll have to monitor to see if this resolved it, but it’s better than what we had been seeing.

David, since you’re using NIO connector do you also get this warning message about Comet support:

elo 12, 2013 9:07:55 AP. org.atmosphere.cpr.AtmosphereFramework doCometSupport
WARNING: Failed using comet support: org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket, error: Tomcat failed to detect this is a Comet application because context.xml is missing or the Http11NioProtocol Connector is not enabled.
If that’s not the case, you can also remove META-INF/context.xml and WEB-INF/lib/atmosphere-compat-tomcat.jar Is the Nio or Apr Connector enabled?
elo 12, 2013 9:07:55 AP. org.atmosphere.cpr.AtmosphereFramework doCometSupport
WARNING: Using org.atmosphere.container.Tomcat7BIOSupportWithWebSocket

As it turned out, after ensuring all of the atmosphere JARs were included, some pages would essentially hang the UI with pushmode automatic (I’d get a successful notification that my app did the requested action after pressing a button, for example, but then the loading indicator would appear on its own a second or so later and never go away). When I turned back to pushmode disabled, the app works fine again.

This is all I see in our logs as it relates to atmosphere:

[font=Courier New]
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed AtmosphereHandler com.vaadin.server.communication.PushHandler mapped to context-path: /*
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.DefaultBroadcaster
INFO: /* support Out Of Order Broadcast: false
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework autoDetectWebSocketHandler
INFO: Auto detecting WebSocketHandler in /WEB-INF/classes/
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework initWebSocket
INFO: Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework autoDetectContainer
INFO: Atmosphere is using async support: org.atmosphere.container.Tomcat7AsyncSupportWithWebSocket running under container: Apache Tomcat/7.0.42
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor
INFO: Installed Default AtmosphereInterceptor [Android Interceptor Support, SSE Interceptor Support, JSONP Interceptor Support, Atmosphere JavaScript Protocol, Browser disconnection detection]
. Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults in your xml to disable them.
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
WARNING: No BroadcasterCache configured. Broadcasted message between client reconnection will be LOST. It is recommended to configure the org.atmosphere.cache.UUIDBroadcasterCache
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
INFO: Shared ExecutorService supported: true
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
INFO: HttpSession supported: true
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
INFO: Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
INFO: Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
INFO: Using Broadcaster: org.atmosphere.cpr.DefaultBroadcaster
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework init
INFO: Atmosphere Framework 1.0.14.vaadin4 started.
Aug 09, 2013 8:41:15 PM org.atmosphere.cpr.AtmosphereFramework interceptor
INFO: Installed AtmosphereInterceptor Track Message Size Interceptor using |.
Aug 09, 2013 8:41:32 PM org.atmosphere.cpr.DefaultBroadcaster perRequestFilter
WARNING: Request is not longer valid 1de10166-ed3f-4b5d-8325-233e68a5c05e

[/font]

We had similar issues with Push on Vaadin 7.1.2 on Tomcat 7.0.42
We couldn’t figure it out and decided to switch back to Polling.

Some other things we had was:

  • If you have an Apache Webserver infront of Tomcat (Apache can not handle WebSockets) atmosphere fallback to Streaming that is OK but the Error Handling is different from UI without push (like Communication/Internal Errors did not show and the normal Tomcat 500 page will be printed - maybe even without Apache infront of tomcat

  • In some cases the Session timeout will be set to -1 (see other forum threads about this)

What value do you use for your polling interval?

First 10 sec, know increased to 60 sec.
Ui lazy loading is with this not really possible.