Bot hangs after the connection to Discord as it's loading the data files for very large bots or large data set #3045
Labels
Status: Accepted
We want this
Type: Bug
Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Other bugs
On a very large bot, or one with a large data set, the bot hangs after the connection to Discord as it's loading the data files.
This can result in a lot of heartbeat blocked messages for up to ~10 minutes in my case (~45 seconds for @aikaterna bot, cat, and almost the same for @kennnyshiwa bot) and can also result in the bot being disconnected from Discord on startup.
In my case it results in 2-3 disconnects, and a lot of retries to launch all the shards, with sometimes one or two shards totally dead for 5mins or more when the bot is fully started.
For context when writing this issue, my bot have 6155 guilds, aika's bot 495, and kennny's bot is on 397 guilds.
I also tried to use another storage backend, MongoDB, but it was even worse, the bot was simply not able to connect to Discord.
Is there a way to rearrange Red's order of operations to
load the data -> connect to Discord all the shards -> load cogs -> tell the bot it's ready and then make the bot usable
or another process that would not block the bot.The text was updated successfully, but these errors were encountered: