-
-
Notifications
You must be signed in to change notification settings - Fork 70
Cannot Reconnect: connection already exist #390
Comments
You aren't alone with this issue. A discord user reported the same. For progress on improving the gateway; I've simply written a new gateway system. It's not done yet, but one of the features is to give you complete control over your shards and handle exit codes (if you want to). Otherwise it just runs in the background as normal. However, it's much easier to write tests for it. https://github.com/andersfylling/discordgateway Sadly I'm uncertain when I will be merging this into disgord. Missing write capability and proper testing of heartbeats. |
@andersfylling All good! Good to know that I'm not missing some low-hanging fix. I can implement a force-exit for myself in the meantime. |
I've been saving debug logs for over a month in the hopes of finding a specific error to target with a force-exit. However, I've not encountered the same disconnect since. My assumption is that the root cause was on Discord's end. Still would like to see better error handling but if that's already being tracked via another issue/branch (e.g. gateway rewrite), I recommend closing this issue. |
There is still the matter of how shards should be implemented in disgord after that discordgateway project is "done". I think I want to allow people to inject a ShardManager so they can easily get complete control. But I'm uncertain how I want to deal with errors, blocking? non blocking? etc. |
My opinion: In a world where production services are orchestrated (Kubernetes, docker-compose, etc.) it's safer to default to crashing an app instead of continuing to run a, deceptive, bad state. If I were in your shoes, I would default to having any unhandled error crash the app (i.e default |
This has been happening since 2019 and is still not fixed in 2023 |
Getting a random reconnect fail. I can't reliably reproduce this aside from just waiting for it to eventually happen.
Logs:
The fix is to recreate the pod (container). The process immediately reconnects with the new process.
Connection Code:
Also, if the issue is sporadic and difficult to resolve within code, it'd be better for the process to exit to let the platform solve the issue (e.g. After x retries, exit process).
The text was updated successfully, but these errors were encountered: