improve gateway stability against new discord error conditions - #2455
Open
akiraveliara wants to merge 4 commits into
Open
improve gateway stability against new discord error conditions#2455akiraveliara wants to merge 4 commits into
akiraveliara wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
if we received an invalid HELLO (or probably also READY) event, DSharpPlus would trigger the resume procedure. if the shard never successfully connected, this is fine, because the resume URL and session ID will be null and it'll trigger a hard reconnect, but if it did successfully connect before, it would reuse that resume URL and session ID for a resume attempt that may now be invalid. this would cause shards to stall infinitely in an attempt to resume before a session was established in the first place
if discord closed the gateway without an error code, DSharpPlus would crash the shard. we will now attempt to resume.
if discord sent an invalid gateway payload, DSharpPlus would crash the shard to restart from a clean slate. it now waits for five consecutive invalid events before rendering judgement so as to allow for transient errors
MultiShardOrchestrator would previously always immediately reconnect a failed shard without considering that many shards can fail at once. this adds a concurrency limit (currently of 1, since the actual gateway concurrency limit is more perfidious and 1 should guarantee success) to multi-sharded reconnects
This pull request did not involve AI in any way
All features in this pull request were tested.
currently untested because i can't test this, don't merge yet
this PR initially only intended to fix the first issue, but the list has grown