Reconnect does not work with Chrome/serverSentEvents transport when server disappears/reappears #1946

Closed
jlew-cs opened this Issue Apr 25, 2013 · 7 comments

Comments

Projects
None yet
8 participants

jlew-cs commented Apr 25, 2013

Reproduced this in 1.0.1. and 1.1-beta1. Steps to repro:

  1. Load a web page in Chrome that establishes a serverSentEvents hub connection.
  2. Shut down the web server
  3. Bring the web server back up

Between step 2 and 3, you will see a reconnect attempt in the console every second or so, but upon restoring the web server, there are no more console traces until the 30 second timeout has elapsed, when it stops trying.

Owner

davidfowl commented May 4, 2013

That's by design. We only retry for about 30 seconds then we raise disconnected client side. If you want to reconnect infinitely handle reconnecting then you need to restart the connection in the disconnected event. If you're saying it doesn't retry once the server is started and the connection still isn't established then that's a bug but it's unclear from your description which one it is.

jlew-cs commented May 6, 2013

The server is brought back up well before the 30 seconds are up, and it always fails to reconnect and times out.

Xiaohongt was assigned May 22, 2013

Owner

DamianEdwards commented May 22, 2013

@Xiaohongt please try to repro this

Contributor

gustavo-armenta commented May 30, 2013

I can repro, we should assign to a dev. It's only trying to reconnect twice in a 10 second period, so it the server goes up after the two retries the client does not attempt a third time.

[15:41:50 GMT-0700 (Pacific Daylight Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.3'. jquery.signalR.js:50
[15:41:50 GMT-0700 (Pacific Daylight Time)] SignalR: Attempting to connect to SSE endpoint
[15:41:58 GMT-0700 (Pacific Daylight Time)] SignalR: EventSource reconnecting due to the server connection ending jquery.signalR.js:50
[15:42:00 GMT-0700 (Pacific Daylight Time)] SignalR: Attempting to connect to SSE endpoint
[15:42:05 GMT-0700 (Pacific Daylight Time)] SignalR: Attempting to connect to SSE endpoint
[15:42:30 GMT-0700 (Pacific Daylight Time)] SignalR: Couldn't reconnect within the configured timeout (30000ms), disconnecting. jquery.signalR.js:50

Owner

DamianEdwards commented May 31, 2013

Thannks @gustavo-armenta

@NTaylorMullen can you take a look at this one please.

Contributor

gustavo-armenta commented Jun 27, 2013

Here is a good repro
iisreset -stop & timeout 15 & iisreset -start

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Jun 28, 2013

@NTaylorMullen NTaylorMullen Removed timeout connecting check from server sent events start logic.
- This is legacy code, this logic used to ignore reconnect events when a connection was initially started to prevent multiple connections from spawning, now that connection timeout's are handled at the core level and not the transport level this is not needed.

#1946
390c0b9

@NTaylorMullen NTaylorMullen added a commit that referenced this issue Jul 3, 2013

@NTaylorMullen @NTaylorMullen NTaylorMullen + NTaylorMullen Removed timeout connecting check from server sent events start logic.
- This is legacy code, this logic used to ignore reconnect events when a connection was initially started to prevent multiple connections from spawning, now that connection timeout's are handled at the core level and not the transport level this is not needed.

#1946
be337d5
Contributor

Xiaohongt commented Jul 5, 2013

verified that on JS serverSentEvent reconnected when the web site stop about 25 seconds and restart

Xiaohongt closed this Jul 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment