Skip to content
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

[Bug?]: 反向websocket连接到后端时不时出现断线然后重联,导致消息丢失 #685

Open
4 tasks done
TU-O0T opened this issue Nov 16, 2024 · 0 comments
Open
4 tasks done
Labels
bug? Maybe it's a bug

Comments

@TU-O0T
Copy link

TU-O0T commented Nov 16, 2024

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述内容
  • 我已经使用 最新构建 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(其它疑问请考虑加入TG群询问或在discussions中提问)

Lagrange项目

OneBot

所使用/依赖的Lagrange项目对应的commit

Lagrange.OneBot Version: 0.0.3+47b819d43ad101a1a066a3f8afa094d000fe19f5

运行环境

Linux

运行架构

x64

连接方式

反向 WebSocket

重现步骤

较短时间内大量用户对机器人的请求

期望的结果是什么?

让Lagrange 稳定保持对机器人后端的连接

实际的结果是什么?

当较多用户在较短时间内请求机器人时,机器人后端和Lagrange 的websocket连接有几率断开,导致看Lagrange 日志是能收到消息但机器人后端(如koishi、nonebot2)收不到消息。大约在十几秒后连接恢复。

简单的复现代码/链接(可选)

No response

Trace 级别日志记录(可选)

warn: Lagrange.Core.BotContext[0]
      [2024-11-15 14:50:41] [BusinessContext] [WARNING]: Error when processing the event: Lagrange.Core.Internal.Event.Message.SendMessageEvent
warn: Lagrange.Core.BotContext[0]
      [2024-11-15 14:50:41] [BusinessContext] [WARNING]: System.Net.Http.HttpRequestException: An error occurred while sending the request.
       ---> System.Net.Http.HttpIOException: The response ended prematurely. (ResponseEnded)
         at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
         at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
         at System.Net.Http.HttpMessageHandlerStage.Send(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.SocketsHttpHandler.Send(HttpRequestMessage request, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
         at System.Net.Http.HttpClient.Send(HttpRequestMessage request)
         at Lagrange.OneBot.Utility.OneBotSigner.Sign(String cmd, UInt32 seq, Byte[] body, Byte[]& e, String& t)
         at Lagrange.Core.Internal.Packets.SsoPacker.Build(SsoPacket packet, BotAppInfo appInfo, BotDeviceInfo device, BotKeystore keystore, SignProvider signProvider)
         at Lagrange.Core.Internal.Context.PacketContext.SendPacket(SsoPacket packet)
         at Lagrange.Core.Internal.Context.BusinessContext.SendEvent(ProtocolEvent event)

补充说明(可选)

系统:Debian12
nonebot2和koishi均在物理机上运行
Lagrange在docker中运行,网络模式为hosts

@TU-O0T TU-O0T added the bug? Maybe it's a bug label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Maybe it's a bug
Projects
None yet
Development

No branches or pull requests

1 participant