Bad Gateway kills application client (long polling request timeout)

Hi everyone,

We are using Vaadin push with long polling in one of our applications and have run in to some issues when using Vaadin 7.6.2 compared to 7.5.10. In short, the client ceases to work after exactly four minutes after the last long polling request was sent to the server. One of our network components sends a “Bad Gateway” error message with an HTML body which causes to client to freak out (grey error bar on the top part of the screen). Funnily enough, this never occured under 7.5.10 and after rolling back, hasn’t occured since.

There seems to be a problem with the long polling rework done for Vaadin 7.6. It seems to be less tolerant to unexpected response messages than it was previously. This is particulary strange, because the release notes claimed the rework was geared towards working better with proxies etc.

Is there some parameter we can set to force the server to respond to open long polling requests within less than four minutes? Since heartbeats aren’t actual reponses to the long polling request, making their interval shorter doesn’t seem to help.

I would appretiate any thoughts or suggestions on this problem.

Timothy Morschel

PS: We are using Tomcat 8 behind an Apache 2.4 server (with mod_jk) as a reverse proxy on the same machine. This machine is protected by a firewall and only responds to SSL requests with valid client certificates.

Hi Tim!

After digging around in the vaadin sources and recalling some knowledge from our atmosphere experiments last year I found a solution for our problem ( btw. for all others Tim and I working on the same project):

From atmosphere point of view the GET request is suspended for a certain Atmosphere resource with the suspend call. This is done in the com.vaadin.server.communication.PushHandler. Per default it is suspended infinite. But the PushHandler has a longPollingSuspendTimeout member. Tracing the chain how the push handler is created and initialised I found the Vaadin Servlet Parameter “pushLongPollingSuspendTimeout” is set to the PushHandler. You can initialise it in the web.xml or like in our case through the annotation:

@WebServlet(urlPatterns = “/*”, name = “XXXServlet”, asyncSupported = true, initParams={@WebInitParam(name=“pushLongPollingSuspendTimeout”,value=“10000”)})

The value is measured in milliseconds.
After knowing what to look for I found
this chapter
in the vaadin wiki. Maybe vaadin team can add this to the documentation.

But I have no clue why it worked with the old version.

i have given like below,
@WebServlet(urlPatterns = “/*”, name = “XXXServlet”, asyncSupported = true, initParams={@WebInitParam(name=“pushLongPollingSuspendTimeout”,value="55000 ")})

But sometime in browser, It is taking more than a minute. It should take less than a minute.
I would really proud if anyone given suggestion or solution for this problem

Best Regards,
Pazhani Deva