GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — improve gateway stability against new discord error conditions by akiraveliara · Pull Request #2455 · DSharpPlus/DSharpPlus

Conversation

@akiraveliara

@akiraveliara akiraveliara commented Aug 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • 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.

this PR initially only intended to fix the first issue, but the list has grown

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akiraveliara
fix shards dying on receiving an invalid hello event
58a1664
@akiraveliara akiraveliara added this to the v5.0 milestone Aug 5, 2026
@akiraveliara akiraveliara added bugfix core labels Aug 5, 2026
akiraveliara added 2 commits August 6, 2026 17:36
@akiraveliara
if disconnecting fails due to already being disconnected, that's fine
35d85b0
@akiraveliara
stagger reconnect attempts in multi-sharded environments and handle i…
2e36edc
…nvalid payloads more gracefully
@akiraveliara akiraveliara changed the title fix shards dying on receiving an invalid hello event improve gateway stability against new discord error conditions Aug 10, 2026
@akiraveliara
attempt resuming on the gw closing without close code
99bb8a1
Plerx2493
Plerx2493 approved these changes Aug 19, 2026
View reviewed changes
@akiraveliara
akiraveliara merged commit 29fab19 into master Aug 19, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@akiraveliara
akiraveliara deleted the aki/fix-shards-dying-on-invalid-hello branch August 19, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Plerx2493 Plerx2493 Plerx2493 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bugfix core

Projects

None yet

Milestone

v5.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@akiraveliara @Plerx2493
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.