yyuueexxiinngg / onebot-kotlin

OneBot标准的Kotlin实现及mirai插件 - 原cqhttp-mirai
GNU Affero General Public License v3.0
582 stars 138 forks source link

[BUG]WS Reverse重连有几率出现WS会话未清除导致重连失败 #81

Closed yyuueexxiinngg closed 3 years ago

yyuueexxiinngg commented 4 years ago

相关Issue: https://github.com/yyuueexxiinngg/cqhttp-mirai/issues/74

15:05:13 [WARNING] [CQHTTPMirai] WS Reverse事件发送失败, 连接已被关闭, 尝试重连中 127.0.0.1:8080-Client-Universal
 15:05:13 [DEBUG] [CQHTTPMirai] 127.0.0.1:8080-Client-Universal 开始启动
 15:05:13 [WARNING] [CQHTTPMirai] Websocket session alredy exist, 127.0.0.1:8080-Client-Universal

复现

Websocket 反向客户端重连时概率出现

版本

cqhttp-mirai- 0..2.3

Commit: https://github.com/yyuueexxiinngg/cqhttp-mirai/commit/8621e256f8b29426a9188390caba8b82db5022fc

mirai-core-1.2.2

mirai-console-0.5.2

yimo0908 commented 3 years ago

我也复现了这个bug 版本信息: onebot-kotlin-0.3.2-all

2020-11-24 10:01:37 W/OneBot: WS Reverse事件发送失败, 连接已被关闭, 尝试重连中 xn--v9x.net:80-Client-Universal
2020-11-24 10:01:37 W/OneBot: Websocket session already exist, xn--v9x.net:80-Client-Universal
LittleNightmare commented 3 years ago

随着时间的增加,概率会变成必然

但上个环境没有出现问题,,不保证环境准确无误

cqhttp-mirai-0.2.3-embedded-all
mirai-console-1.0-M3-all
mirai-core-qqandroid-1.2.2

这是错误初次发生后,有一个奇怪的日志

2020-11-24 23:00:19 W/OneBot: Websocket连接出错, 可能被服务器关闭, 将在3秒后重试连接, Host: xn--v9x.net:443-Client-Universal Path: /ws
> 
2020-11-24 23:00:22 D/OneBot: xn--v9x.net:443-Client-Universal Websocket Client启动完毕
> 
2020-11-24 23:00:22 D/OneBot: xn--v9x.net:443-Client-Universal 开始启动
> 
2020-11-24 23:00:24 W/OneBot: Websocket session alredy exist, xn--v9x.net:443-Client-Universal
> 
2020-11-24 23:00:29 W/OneBot: Websocket连接已断开, 将在3秒后重试连接, Host: xn--v9x.net:443-Client-Universal

这里面的Websocket session alredy exist是在本次启动中初次发生,但在前两条,Websocket Client启动完毕开始启动在时间戳上是相同的

yyuueexxiinngg commented 3 years ago

刚Push了一个修复尝试, 请在Action中下载测试, 谢谢

LittleNightmare commented 3 years ago

刚Push了一个修复尝试, 请在Action中下载测试, 谢谢

已经开始测试了,挂一会看看吧

目前9小时左右,问题没有再次出现,应该可以认为是修复了