New issue
Advanced search Search tips

Issue 837575 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Websocket Connection Requests get stuck occasionally when switching between html5 livestreams

Reported by mbuerger...@gmail.com, Apr 27 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

Example URL:
https://livejasmin.com

Steps to reproduce the problem:
1. Open a html5 livestream
2. Switch to another stream from the same tab multiple times

What is the expected behavior?
The stream starts correctly

What went wrong?
"We found the stream is not playing occasionally when switching streams constantly, and on some environments even just at first try after refreshing.
The reason is that there are websocket connections open stuck in a connecting state, they never reach the connect state, and we don't see TCP packets reaching the server, We found that adding a random query parameter to the websocket url mitigates the problem, but it doesn't solve it 100% of the times (maybe we happen to hit already used random ids?)."

Did this work before? Yes Chrome 65

Chrome version: 66.0.3359.139  Channel: stable
OS Version: High Sierra
Flash Version: 

It seems the issue is not reproducible with Chrome 67 or Chrome 68 builds. Is it possible to backport this fix to a Chrome 66 release? Is there any better workaround than this random id?
 
Reproducible also from Chrome 66 on Win , but appears less frequently.

Comment 2 by ricea@chromium.org, Apr 27 2018

Components: -Internals>Network Blink>Network>WebSockets
This is probably caused by WebSocket throttling, which slows down new connections when there have been many failed or incomplete connections recently. If this is the issue, then ensuring that all connections are cleanly closed will resolve it.
Thanks for the quick reply, we will look into it to confirm that all connections are closed properly to see if it resolves it.
Labels: Needs-Bisect Needs-Triage-M66
Cc: susan.boorgula@chromium.org
Labels: Triaged-ET Needs-Feedback
mbuerger.rlp@ Thanks for the issue.

Request you to provide another link where this issue can be reproduced, as the above given link is a bad site. We won't be able to triage this issue further with that site.

Thanks..

Comment 6 by ricea@chromium.org, May 11 2018

If a WebSocket connection is still opening, it's good to give it a chance to finish connecting so that it will be closed cleanly and not count as a connection failure. Here's an example of what I mean:

function disposeWebSocket(ws) {
  ws.onclose = ws.onerror = ws.onmessage = null;
  switch (ws.readyState) {
    case WebSocket.CONNECTING:
      ws.onopen = () => {
        ws.close();
      };
      setTimeout(() => {
        if (ws.readyState === WebSocket.CONNECTING) {
          ws.close();
        }
      }, 1000);
      return;

    case WebSocket.OPEN:
      ws.close();
      return;

    default:
      return;
  }
}

I used a timeout so that it doesn't wait too long for a connection to complete.

Comment 7 by ricea@chromium.org, Jun 8 2018

Status: WontFix (was: Unconfirmed)
Closing as it looks like the problem is resolved.

Sign in to add a comment