rickilama54 / gwt-comet

Automatically exported from code.google.com/p/gwt-comet
0 stars 0 forks source link

Reconnection stampede in Chrome #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start GWT client in Chrome
2. Shutdown the server
3. The client will attempt to reconnect periodically (1000 ms by default)
4. Start the server again
5. Wait for the client to reconnect
6. Go to Chrome address bar and hit enter (do not press reload)

What is the expected output? What do you see instead?

The client will be reloaded and establish a new connection on the server using 
the same cookie (?). However, the server-side session already has a response 
associated with it and will terminate the new connection. This will cause the 
client to reconnect, rinse and repeat, leading to a stampede of failed 
connections.

I would expect gwt-comet to handle this case more gracefully.

What version of the product are you using? On what operating system?

1.1.5 on OS X.

Please provide any additional information below.

If reloading the client-side application instead of hitting enter in the 
address bar, a new session will be established, avoiding this problem.

I haven't tried this with the Chat client yet - it's possible that the problem 
is with my implementation. I'll try this next. In the meantime I'll try 
disabling reconnection and see if that helps.

Original issue reported on code.google.com by julian...@gmail.com on 8 Jun 2010 at 3:51

GoogleCodeExporter commented 9 years ago
Are you sure that you are not using multiple windows/tabs? gwt-comet does not 
support more than one window/tab.

Original comment by rich...@zschech.net on 9 Jun 2010 at 10:58

GoogleCodeExporter commented 9 years ago
I'll double-check but I'm pretty sure that as far as this ticket is concerned 
there was only one window open.

Also, I've been using Comet with multiple windows/tabs just fine. If that 
wouldn't work reliably I'd have to look for an alternative because there's no 
way I can keep my users from always limiting themselves to one tab. But as I 
said, appears to work just fine in all major browsers.

Original comment by julian...@gmail.com on 9 Jun 2010 at 11:04

GoogleCodeExporter commented 9 years ago
Concerning multiple windows/tabs:
comet-gwt adds itself to the httpsession. As far as I know, it's not possible 
to have two different sessions in the same browser window in two different tabs 
when using cookies. 

So, the question is: to which tab does the server send messages?

About point 4 of your problem description: Did you turn of session persistence 
on your server?

Original comment by mmm1...@gmx.net on 13 Aug 2011 at 7:09

GoogleCodeExporter commented 9 years ago
I can't see the difference between multiple tabs connecting to the same server, 
and multiple clients (e.g. different hosts) connecting to the same server.  I 
would expect the server to send messages to all tabs, but maybe I'm missing 
something.

Sorry but I don't remember whether session persistence was turned on or off and 
can't find out easily at this point.

By the way, I've switched to Atmosphere/GWT a while ago and so I'm not 
interested in a solution for this ticket anymore. Please feel free to close it.

Original comment by julian...@gmail.com on 13 Aug 2011 at 9:38

GoogleCodeExporter commented 9 years ago
Whoops, it's been a while since I was working with this.  I guess the 
difference is that multiple tabs in the same browser would share the same 
cookies and hence might share the same HttpSession.

Original comment by julian...@gmail.com on 13 Aug 2011 at 9:42