views:

183

answers:

2

I am making an http request which ends up taking more than 8 mins. For me, this long running request work fine. I am able to get a response back to my browser without any issues. (I am located on the same network as the server).

However, for some users, the browser never returns any response. (Note: When the same http request executes in 1 min, these users are able to see the response without any problem)

These users happen to be on another network. And there probably is a firewall or two between their location and the server.

I can see on their fiddler that the request is just sitting there waiting for a response.

I am right now assuming that firewall is killing the idle http connection.. but I am not sure.

If you have any idea why the response never gets back, or why the connection never breaks.. it will be really helpful.

Also: Is it possible to fix this issue by writing an Applet that somehow manages to keep the sending dummy signal to the server, even after having sent (flushed) the request to the server?

Thanks for reading, and any input will be greatly appreciated.

A: 

Have you considered that the users might be using a browser which has a HTTP timeout which causes the browser to stop waiting for a response after a certain amount of time?

RobV
The problem is, that the users were able to run long requests going to a a Windows-IIS Server... So I don't think its related to the browser.
rjk2008
A: 

The users might be behind a connection tracking firewall/NAT gateway. Such gateways tend to drop the TCP connection when nothing has happened for a period of time. In a custom protocol you could send some kind of heartbeat messags to keep the TCP connection alive, but with HTTP you don't have proper control over that connection, nor does HTTP facilitate what's needed to keep a tcp connection "alive".

The usual way to handle long running jobs initated by an HTTP request is to fire off that job in the background, sending a proper response back to the client immediately and have an applet/ajax request poll the status of that job and returning the result when it's done.

If you need a quick fix, see if you can control any timeouts on the gateways between the server and the user.

nos
In my last comment I have mentioned that the users were able to run long running requests on an IIS server.. so even though most fingers are pointing to the firewall... I am finding it hard to come to that conclusion. btw, The server on which the requests are failing is linux+weblogic/websphere.
rjk2008
marking this comment as the answer, but to be honest I am not closer to fixing the problem. Will update here if we find a way to do a long synch process "without" using any new tool (icefaces, comet, etc) on the server side. Polling doesn't seem more attractive than asynch right now.
rjk2008
Just find a way to monitor the packets on each leg of the firewall with Ethereal. and see if the packets stop anywhere. Apache has the simple Timeout directive which defaults to 300 seconds, which among other things controls the timeing out of a response. Websphere seems to have a phleora of timout configuration , I can't work out which one you need to adjust - but chances are there's a setting you might need to tweak - perhaps ConnectionResponseTimeout
nos