What happens at 2,500 guilds/shard if you don't automatically reshard

What happens if a shard exceeds its maximum number of guilds? Does that shard crash (due to discord disconnecting the gateway client and it not being allowed to reconnect any longer), or does the entire parent process exit as well (allowing an automatic restart to properly reshard as a fallback without duplicate/orphan processes running)
15 Replies
d.js toolkit
d.js toolkit•9h ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
monbrey
monbrey•9h ago
It doesnt though
nick.
nick.•9h ago
wdym by this? does djs automatically handle resharding? i've seen mixed info on this
monbrey
monbrey•9h ago
Discord wont allocate more guilds to shards The question I think then is what the behaviour is for an unhandled new shard?
nick.
nick.•9h ago
wdym by this, because if say you have 3 shards running and a new guild gets invited, of course one of those shards has to handle it
monbrey
monbrey•9h ago
No, unless I'm mistaken Discord wont assign that guild to a shard if it would exceed 2500
nick.
nick.•9h ago
the question is what happens if say you have 2 shards running and your bot exceeds 5,000 servers (or 2,500 servers on any one shard), does a shard die or does the parent process die
Mark
Mark•9h ago
I thought it would and that the shard count only mattered when starting the bot
nick.
nick.•9h ago
oh really? didn't know that
monbrey
monbrey•9h ago
I thought it was Discord enforced, idk Time to research!
nick.
nick.•9h ago
same ahah hmm the gateway page on the docs don't seem to clarify
Each shard can only support a maximum of 2500 guilds, and apps that are in 2500+ guilds must enable sharding.
this is all we get
monbrey
monbrey•9h ago
yeah I thought it was more specific
nick.
nick.•9h ago
this is something that could really do with better clarification on discord's end since it's straight up undefined behavior rn
monbrey
monbrey•9h ago
Probably a question to ask in the Discord Developers server
nick.
nick.•9h ago
yep I suppose to keep this question on topic since I was more interested in discord.js's behavior. If it does turn out to be that discord closes the connection with a 4011, what does discord.js do here, does it try to respawn that shard specifically (which would infinitely fail due to not being a valid num_shards anymore), or does it "reshard" entirely?
Want results from more Discord servers?
Add your server