-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
安卓平台(Android 7+)长时间运行mirai会输出“Bot is closed manually”,然后就没有任何输出了 #1509
Comments
比较想知道,如果不是主动调用bot.close(),还有哪些情况会导致“Bot is closed manually”? |
可能和这个问题一样? #1466 |
Provide |
日志有点难复现,研究中 |
@Karlatemp 已复现,此时输出了“Bot is closed manually”后不再有下文,日志比较长只截取了后半部分的日志,如果需要全部日志可以提一下。 |
个人感觉这【不太像】网络离线,因为“Bot is closed manually”之后,框架就完全没有反应了,也并没有触发bot离线等事件,没有任何报错信息。 |
我不确定是不是因为这段代码造成的:
我已经改成了
看看到底是不是它的问题,我咋那么高度怀疑呢。。。 好,不是我这边的问题,依然是“bot is closed manually” |
一个简单的修复方案
修改为
原因是某些情况下的异常连接关闭会被netty认为是正常关闭,不抛出任何异常 mirai/mirai-core/src/commonMain/kotlin/network/impl/netty/NettyNetworkHandler.kt Line 160 in 8271fa9
可以观察到
|
我也出现过这个问题,不过我的环境比较特殊。 |
经过一段时间测试,似乎2.7.1-DEV-1没什么问题了 |
在安卓平台长时间登陆mirai,一段时间之后(大约几个小时),控制台会输出”Bot is closed manually“,从此再无任何响应,再任何事件(哪怕是掉线事件)。
复现
在安卓平台长时间登陆mirai达到几个小时即有可能出现,暂未发现准确的复现规律
版本及相关选项选择
2.7.0
网络日志
补充信息
【所有的假死】都是从输出一句”Bot is closed manually“开始的。
The text was updated successfully, but these errors were encountered: