Issue metadata
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 descriptionUserAgent: 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?
,
Apr 27 2018
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.
,
Apr 27 2018
Thanks for the quick reply, we will look into it to confirm that all connections are closed properly to see if it resolves it.
,
Apr 30 2018
,
Apr 30 2018
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..
,
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.
,
Jun 8 2018
Closing as it looks like the problem is resolved. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by mbuerger...@gmail.com
, Apr 27 2018