Closed Bug 1342899 Opened 7 years ago Closed 6 years ago

websocket failed connections are stacked up?

Categories

(Core :: Networking: WebSockets, defect, P2)

51 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: geethanjali.eswaran, Assigned: michal)

Details

(Whiteboard: [necko-active])

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce:

* A simple python WebSocket server(example: https://github.com/dpallot/simple-websocket-server)
* A simple client which retries to establish WebSocket connection on failure/close (example: https://gist.github.com/geethanjalieswaran/dc5a432a4f1e45df253eb1d29d76a73e)

1. start the python server
2. open/run the client on FF 
3. stop the server for ~5 mins, but keep the client open
4. start the server and you can see a flood of stacked up WebSocket connections.




Actual results:

In Developer console-Network tab, you will see all the failed WebSocket connections are established again. We didn't observe this behavior on Chrome. We are noticing this behavior in past 6 months. 


Expected results:

Apparently, only one WebSocket connection should have been established instead of all the stacked failed connections.
Component: Untriaged → Networking: WebSockets
Assignee: nobody → michal.novotny
Whiteboard: [necko-active]
Bulk priority update: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P1
Priority: P1 → P2
(In reply to Geethanjali Eswaran from comment #0)
> * A simple client which retries to establish WebSocket connection on
> failure/close (example:
> https://gist.github.com/geethanjalieswaran/dc5a432a4f1e45df253eb1d29d76a73e)

The example creates new WebSocket connection in afterTimeout function without closing the old one. Firefox implements truncated exponential backoff for reconnecting after failure (as specified in https://tools.ietf.org/html/rfc6455#section-7.2.3) and the maximum delay is 60 seconds. This means that after a while we fail connections after 60 seconds but a new one is added every 15 seconds. All the connections are queued and once a connection succeeds all queued connections are connected one by one.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.