如何使用“未知原因"调试websocket连接错误? [英] How to debug websocket connection error with "Unknown reason"

查看:376
本文介绍了如何使用“未知原因"调试websocket连接错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我在chrome控制台上收到以下消息;

Recently, I am getting the following message on chrome console;

WebSocket connection to 'ws://evo15:4008/?stream' failed: Unknown reason

它变得越来越多,并且以某种方式令人讨厌,我每次必须打开一个新标签或重新启动chrome才能恢复正常的websocket连接.我该如何调试?不幸的是,我还不能复制它.我的Chrome版本是Version 77.0.3865.75 (Official Build) (64-bit)

It's getting more and more and it's somehow annoying and I have to open a new tab or restart chrome every time to get back to normal websocket connection. How can I debug it? Unfortunately, I cannot reproduce it yet. My chrome version is Version 77.0.3865.75 (Official Build) (64-bit)

更新1 :我认为您可以通过长时间关闭服务器端的连接(我不知道确切时间)来重现它,然后打开它并尝试连接到它(客户端尝试每1秒连接一次).然后它将发生.因此,我猜有一个过期时间或尝试连接某处的次数有限.

Update 1: I think you could reproduce it by closing the connection for a long time (I don't know the exact time) from server side and then open it and try to connect to it (client trys to connect every 1 sec). Then it will happen. So I guess there is an expire time or a limited number of tries to connect somewhere.

更新2 :在256次尝试重新连接后发生.

Update 2: It happens after 256 tries of reconnection.

WebSocket connection to 'ws://evo15:4008/?stream' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

在控制台上看到255错误后,您将看到第一个错误,并且无法重新连接.所以我认为我缺少某个地方的8位限制

After seeing 255 of this error on console, you will see the first error and cannot reconnect. So I think there is a 8 bit limit somewhere that I am missing

推荐答案

就像有人刚刚将其提交为Chromium(v77)错误一样.请参见在此处对其进行跟踪.

Looks like someone just filed this as a Chromium (v77) bug. See issue tracking it here.

更新1:如下面的问题跟踪器和注释中所述,现在应该在最新的稳定版本中对此问题进行修复,该最新版本现已发布(2019/10/11).

Update 1: As noted in the issue tracker and comments below, this should now be fixed in the latest stable release, which is being rolled out now (2019/10/11).

更新2:尽管该错误已在单轨中标记为已修复/已修复,但金丝雀(80.0.3977.4)仍似乎具有此行为.正如其他人指出的那样,全局限制为

Update 2: Despite the bug being marked as fixed/closed in monorail, canary (80.0.3977.4) still appears to have this behavior. As others have noted there is a global limit of 255. However, the fact that connections opened by JS don't get closed/reset when the page is refreshed still seems like a bug to me.

这篇关于如何使用“未知原因"调试websocket连接错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆