Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot hangs after the connection to Discord as it's loading the data files for very large bots or large data set #3045

PredaaA opened this issue Oct 9, 2019 · 1 comment · Fixed by #3073
Status: Accepted Type: Bug


Copy link

@PredaaA PredaaA commented Oct 9, 2019

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.

@Flame442 Flame442 added the Type: Bug label Oct 11, 2019
@mikeshardmind mikeshardmind added the Status: Accepted label Oct 18, 2019
Copy link

@mikeshardmind mikeshardmind commented Oct 18, 2019

I'll be reordering these events in an upcoming PR to improve various things with bot performance. Cogs should already not do anything until the bot is "ready", in events and tasks, this is a state which can and should be waited for. bot.wait_until_ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Status: Accepted Type: Bug
None yet

Successfully merging a pull request may close this issue.

3 participants