livepage connection "timing out"/dying randomly
Hey guys, I seem to have a problem with client browsers to my guarded livepage application loosing their livepage connections. It seems that the guard session doesn’t expire, but the livepage system on the server side seems like it will loose track of the client’s nevow handle. This is under the Nevow 0.5.0 release, and it happens under both IE 6.0.x and Firefox 1.0.x. Basically, my server app makes livepage calls to the client browser js via clientHandle.call() to reflect dynamically updated data as it happens… (maybe one call every 4 seconds). At this point I found this problem (that at some point these updates in the client would stop, while the server was still making the livepage call() invocations like everything was fine and dandy). The problem was that things just seemed to die, and I could find no error output showing why. Well, in my search for a fix/error output, I added a js function on the client that calls server.handle('refreshSession()') every 120 seconds via the use of repeated setTimeout() calls. The corresponding handle_refreshSession() function on the server gets that client's session object and touch()es it. This will start out working fine for usually a few hours (the session timeout is 1200 seconds currently), and the client will stay logged in. Then after some seemingly arbitrary amount of time, I will start getting the following errors, one set for each refreshSession() call: From the client side (firefox java console): Error: syntax error Source File: http://216.148.216.20:8800/mon/nevow_glue.js Line: 155 Source Code: <html><head><title>Exception</title></head><body><style type="text/css"> From a glance at nevow_glue.js, it looks like the server returned an exception page to the client and nevow_clientToServerEvent() in nevow_glue.js didn’t like that when it tried to evaluate it as javascript code, or some kind of javascript result. On the server side I get the following python exception: ---**** EXCEPTION START ****--- Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 216, in addCallback callbackKeywords=kw) File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 207, in addCallbacks self._runCallbacks() File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 328, in _runCallbacks self.result = callback(self.result, *args, **kw) File "/usr/lib/python2.4/site-packages/nevow/appserver.py", line 308, in handleSegment return defer.maybeDeferred( --- <exception caught here> --- File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 117, in maybeDeferred result = f(*args, **kw) File "/usr/lib/python2.4/site-packages/nevow/livepage.py", line 596, in locateChild client = self.clientFactory.clientHandles[handleId] exceptions.KeyError: '2' ---**** EXCEPTION END ****--- In this case, the key ‘2’ was the setting of the client’s “nevow_clientHandleID” variable. This will happen every time the client tries to make the call (e.g. every 120 seconds). I think these two types of updates I’m doing (one where the server tries to call a js method on the client when its data is updated, and one where the client periodically “pings” the server) are both exposing the same error. The only difference is that the one where the client pings the server with the server.handle() call exposes some error messages of what may be going wrong. Might I be forgetting to do something, or using livepage improperly? My goal is to make it so that, as long as a client’s browser is logged in and at my page, they will keep getting livepage events indefinitely. Might the newest version from the repository fix this? Thanks for any help, Robby
On Oct 27, 2005, at 1:50 PM, Robby Dermody wrote:
I seem to have a problem with client browsers to my guarded livepage application loosing their livepage connections. It seems that the guard session doesn’t expire, but the livepage system on the server side seems like it will loose track of the client’s nevow handle. This is under the Nevow 0.5.0 release, and it happens under both IE 6.0.x and Firefox 1.0.x.
I believe both livepage and athena currently have broken reconnect support, so if the server->client socket closes unexpectedly for whatever reason (the most common reason is you have an HTTP proxy with a timeout of a small number of seconds), the client will attempt to reconnect to the same livepage session with the same client id (as it should), but the server doesn't accept the reconnect attempt and throws an error. James
James Y Knight wrote:
On Oct 27, 2005, at 1:50 PM, Robby Dermody wrote:
I seem to have a problem with client browsers to my guarded livepage application loosing their livepage connections. It seems that the guard session doesn’t expire, but the livepage system on the server side seems like it will loose track of the client’s nevow handle. This is under the Nevow 0.5.0 release, and it happens under both IE 6.0.x and Firefox 1.0.x.
I believe both livepage and athena currently have broken reconnect support, so if the server->client socket closes unexpectedly for whatever reason (the most common reason is you have an HTTP proxy with a timeout of a small number of seconds), the client will attempt to reconnect to the same livepage session with the same client id (as it should), but the server doesn't accept the reconnect attempt and throws an error.
James
Hi James, It seems to be that way. The connection I was browsing the page through was being port-forwarded through a PIX firewall. I've gone through the VPN (an alternative route that doesn't hit the firewall) and haven't run into a timeout issue so far. Any idea if there's a fix in the works, or if there is anything that I can do? At the very least, it's good to know that the issue is known. Thanks for the insight! Robby
participants (2)
-
James Y Knight
-
Robby Dermody