Closed Lymdun closed 5 years ago
Seems that increasing the value of DefaultRequestTimeout did the job to get rid of the timeouts, but not of the disconnections. Here are more stacktrace of the errors ;
7/1/19 12:49:22 AM [Warning] Shard #1: System.Exception: WebSocket connection was closed ---> Discord.Net.WebSocketClosedException: The server sent close 1000: ""
at Discord.Net.WebSockets.DefaultWebSocketClient.RunAsync(CancellationToken cancelToken)
--- End of inner exception stack trace ---
at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
After the shard reconnected, others were disconnected ;
7/1/19 12:52:46 AM [Info] Shard #3: Disconnecting
7/1/19 12:52:46 AM [Info] Shard #1: Disconnecting
7/1/19 12:52:46 AM [Info] Shard #2: Disconnecting
7/1/19 12:52:46 AM [Info] Shard #5: Disconnecting
7/1/19 12:52:46 AM [Warning] Shard #1: System.Exception: Server missed last heartbeat
at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
7/1/19 12:52:46 AM [Warning] Shard #3: System.Exception: Server missed last heartbeat
at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
7/1/19 12:52:46 AM [Warning] Shard #5: System.Exception: Server missed last heartbeat
at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
7/1/19 12:52:46 AM [Warning] Shard #2: System.Exception: Server missed last heartbeat
at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
Note that I'm using Program.cs & CommandHandlingService from your sharded_client sample. I'm using a VPS with 8Gb of RAM & 8 CPU cores
After heavy tests, it seemed that the issue can be reproduced when spamming a command, even a simple one doing a await ReplyAsync()
Are you running the comamnds in RunMode.Sync
by any chance? By default, this is the expected behaviour since the command runs sequentially with the gateway thread.
Are you running the comamnds in
RunMode.Sync
by any chance? By default, this is the expected behaviour since the command runs sequentially with the gateway thread.
No, even commands with RunMode.Async are causing it
Also, note that this may be a duplicate of #1220, #1207, #960, #856.
For reference, issue solved with a simple cooldown system
simple cooldown system
Isn't that the purpose of an API wrapper library?
For all intents and purposes this ticket is still valid and not a duplicate of #960 that's... not exactly the same problem. #1220 is
14:17:38 Discord Discord.Net v3.9.0 (API v10)
14:17:38 Gateway Connecting
14:17:42 Gateway System.Exception: WebSocket connection was closed
---> Discord.Net.WebSocketClosedException: The server sent close 4014: "Disallowed intent(s)."
at Discord.Net.WebSockets.DefaultWebSocketClient.RunAsync(CancellationToken cancelToken)
--- End of inner exception stack trace ---
at Discord.ConnectionManager.WaitAsync()
at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync()
at Discord.ConnectionManager.ConnectAsync(CancellationTokenSource reconnectCancelToken)
at Discord.ConnectionManager.<>c__DisplayClass29_0.<
Hello,
It seems that since 2.1.1, I can't use Discord.Net in production anymore ; Shards are getting lot of timeouts recently, with this stacktrace ;
Also, I can get these errors, and no reconnect after that :
WebSocket connection was closed ---> The server sent close 1000 : ""
It's hard to repro since it seems to happen only after several hours of running bot. Also, it doesn't seems to happen to every shards.
Environment: Linux Debian Discord .Net version : 2.1.1 WebSockets : Default
By the way, since it's the first time I have the opportunity to say it ; Thanks a lot for your awesome work!