Skip to content

Client webSockts and SSE transports, after reconnected, Disconnect Command from server causes the reconnected connection to disconnect #1273

Closed
Xiaohongt opened this Issue Jan 9, 2013 · 8 comments

5 participants

@Xiaohongt
SignalR member

Repro :
1.You can map the AspNet Sample to IIS website, and build the web site
2.on remote machine, use webSockets or SSE transport to request the IIS website Raw/default.aspx
3.disconnect the network cable about 25 second, and reconnecting event raise
4.re-connect the network cable, and connection become reconnected

after reconnected, you can see that client receives Disconnect Command from server, and client disconnect the connection.

this is regression from RC1.

Shoud we remove that server send Disconnect Command? it is not much useful anymore but causes the issue.

Here are some repro client events:
•[00:30:37 PST]: connected => reconnecting bf2d1bbc-7fb7-456d-b0d4-b34642b7a292
•[00:30:55 PST]: reconnecting => connected bf2d1bbc-7fb7-456d-b0d4-b34642b7a292
•[00:30:55 PST]: Connection re-established
•[00:30:55 PST]: connected => disconnected undefined

Here are some repro client logging:
[00:28:27 PST] SignalR: Negotiating with '/SignalRTest_Release_RC2/signalr/negotiate'.
[00:28:27 PST] SignalR: Connecting to websocket endpoint 'ws://xiaota003-vm02/SignalRTest_Release_RC2/signalr/connect?transport=webSockets&connectionId=bf2d1bbc-7fb7-456d-b0d4-b34642b7a292&connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&tid=1'
[00:28:27 PST] SignalR: Websocket opened
[00:28:27 PST] SignalR: Now monitoring keep alive with a warning timeout of 40000 and a connection lost timeout of 60000
[00:28:27 PST] SignalR: Triggering client hub event 'foo2' on hub 'MyHub'.
[00:30:27 PST] SignalR: Keep alive has been missed, connection may be dead/slow.
SCRIPT12030: WebSocket Error: Network Error 12030, The connection with the server was terminated abnormally

[00:30:35 PST] SignalR: Unclean disconnect from websocket.
[00:30:37 PST] SignalR: Closing the Websocket
[00:30:37 PST] SignalR: Websocket reconnecting
[00:30:37 PST] SignalR: Connecting to websocket endpoint 'ws://xiaota003-vm02/SignalRTest_Release_RC2/signalr?transport=webSockets&connectionId=bf2d1bbc-7fb7-456d-b0d4-b34642b7a292&connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&messageId=B%2C0%7CG%2C1%7CH%2C1%7CI%2C0%7CF%2C0&groups=%5B%22MyHub.group1%22%5D&tid=2'
SCRIPT12007: WebSocket Error: Network Error 12007, The server name or address could not be resolved

[00:30:41 PST] SignalR: Closing the Websocket
[00:30:41 PST] SignalR: Websocket reconnecting
[00:30:41 PST] SignalR: Connecting to websocket endpoint 'ws://xiaota003-vm02/SignalRTest_Release_RC2/signalr?transport=webSockets&connectionId=bf2d1bbc-7fb7-456d-b0d4-b34642b7a292&connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&messageId=B%2C0%7CG%2C1%7CH%2C1%7CI%2C0%7CF%2C0&groups=%5B%22MyHub.group1%22%5D&tid=5'
SCRIPT12007: WebSocket Error: Network Error 12007, The server name or address could not be resolved

[00:30:45 PST] SignalR: Closing the Websocket
[00:30:45 PST] SignalR: Websocket reconnecting
[00:30:45 PST] SignalR: Connecting to websocket endpoint 'ws://xiaota003-vm02/SignalRTest_Release_RC2/signalr?transport=webSockets&connectionId=bf2d1bbc-7fb7-456d-b0d4-b34642b7a292&connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&messageId=B%2C0%7CG%2C1%7CH%2C1%7CI%2C0%7CF%2C0&groups=%5B%22MyHub.group1%22%5D&tid=5'
SCRIPT12007: WebSocket Error: Network Error 12007, The server name or address could not be resolved

[00:30:50 PST] SignalR: Closing the Websocket
[00:30:50 PST] SignalR: Websocket reconnecting
[00:30:50 PST] SignalR: Connecting to websocket endpoint 'ws://xiaota003-vm02/SignalRTest_Release_RC2/signalr?transport=webSockets&connectionId=bf2d1bbc-7fb7-456d-b0d4-b34642b7a292&connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&messageId=B%2C0%7CG%2C1%7CH%2C1%7CI%2C0%7CF%2C0&groups=%5B%22MyHub.group1%22%5D&tid=9'
[00:30:55 PST] SignalR: Websocket opened
[00:30:55 PST] SignalR: Disconnect command received from server
[00:30:55 PST] SignalR: Stopping the monitoring of the keep alive
[00:30:55 PST] SignalR: Closing the Websocket
[00:30:55 PST] SignalR: Websocket closed

@davidfowl
SignalR member

What's the regression here? The fact that the command was received before it needed to be? What does the server side logging look like?

@DamianEdwards
SignalR member

We can't just remove the disconnect command. It's required to help ensure that the disconnect event is only raised once on the server side. With out it, we would raise the disconnect event, then a client could come back (reconnect) and start receiving messages again on the same connection ID. When they do actually disconnect we'd raise the disconnect event again for the same connection ID.

@halter73 halter73 was assigned Jan 9, 2013
@Xiaohongt
SignalR member

if we make server disconnect timeout some bigger than client disconnect timeout, this issue can be fixed

@halter73
SignalR member

This issue seems to have been caused by bad setting in the DefaultConfigurationManager. The following commits address this problem:
1599189...63d7718

@gustavo-armenta

verified using .NET client with WS, SSE, LP

@davidfowl
SignalR member

This doesn't really affect the .NET client.

@gustavo-armenta

need to verify in JS client

@gustavo-armenta

verified in JS client for WS and SSE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.