yuudi / yobot

aide bot for pcr (mobile game) 公主连接群聊机器人
https://yobot.win
GNU General Public License v3.0
573 stars 270 forks source link

[BUG] 短时间内第二次开始的yobot操作出现1分钟左右的延迟 #211

Closed SDR-Fang closed 3 years ago

SDR-Fang commented 3 years ago

第一次在群内/私聊BOT进行的操作一切正常 第二次开始出现很长的延迟,例如"报刀 1"

mirai LOG

 15:37:27 [INFO] [BOT 2091235713] [卡其脱离太Re:dive(852770498)] 凉雨@意识模糊(1807121840) -> [mirai:source:615893,1495008384]报刀 1
 15:37:33 [INFO] [NETWORK] Send: Heartbeat.Alive
 15:37:33 [INFO] [NETWORK] Recv: Heartbeat.Alive.Response
 15:38:07 [INFO] [NETWORK] Send: MessageSvc.PbSendMsg
 15:38:07 [INFO] [NETWORK] Recv: MessageSvcPbSendMsg.Response.SUCCESS
 15:38:07 [INFO] [BOT 2091235713] Group(852770498) <- SDR·Fang@凉雨对boss造成了1点伤害\n(今日第1刀,完整刀)\n现在1周 目,1号boss\n生命值5,999,999

yobot LOG [2021-02-02 15:38:07,093] INFO: 群聊 成功 1807121840 852770498 报刀 1

其他一切正常,也没有报错,包括启动时(除了mirai更新失败) 不确定是什么时候开始的,但国服摩羯座会战(1/11-1/16)时依然正常

yuudi commented 3 years ago

建议看看进程占用,以及 yobot 和 mirai 的版本号是多少

SDR-Fang commented 3 years ago

CPU,内存和磁盘都没什么占用

版本: Windows服务器 yobot v3.6.9便携版 mirai没找到哪个是version

[15:49:45.6443] I MiraiOK 20200629.160938 running at windows-amd64
[15:49:45.7938] I JRE: openjdk version "1.8.0_252"
[15:49:45.7938] I JRE: OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
[15:49:45.7938] I JRE: OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)
shadow-Protocol:C:\Users\Administrator\desktop\qqbot\mirai\content\mirai-core-qqandroid-1.1.3.jar
Console        :C:\Users\Administrator\desktop\qqbot\mirai\content\mirai-console-0.5.2.jar
Root           :C:\Users\Administrator\desktop\qqbot\mirai/

另外翻log翻到了一些Timeout

[2021-02-02 16:12:42,724] ERROR: WebSocket API call timeout
Traceback (most recent call last):
  File "aiocqhttp\api.py", line 101, in fetch
  File "asyncio\tasks.py", line 449, in wait_for
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ybplugins\clan_battle\battle.py", line 203, in _update_user_nickname_async
  File "aiocqhttp\api.py", line 170, in call_action
  File "aiocqhttp\api.py", line 140, in call_action
  File "aiocqhttp\api.py", line 105, in fetch
aiocqhttp.exceptions.NetworkError: WebSocket API call timeout
yuudi commented 3 years ago
aiocqhttp.exceptions.NetworkError: WebSocket API call timeout

这样看起来是 mirai 或者 onebot-kotlin 那边处理超时了

不知道其他的 onebot-kotlin 插件是否也有类似情况,或者可以考虑换到 go-cqhttp 平台

SDR-Fang commented 3 years ago

好的,既然可能不是yobot这边的问题我就先close了,感谢解答

yuudi commented 3 years ago

好像有点问题,有许多类似的情况出现了,都是在 update_user_nickname 这一步超时了,我得检查一下

yuudi commented 3 years ago

已经确定这个问题是 3.6.9 版本更新的依赖问题,最新版本 3.6.10 已经修复