-
Notifications
You must be signed in to change notification settings - Fork 417
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
Event Loop blocks while Sending Large Attachments #1321
Comments
This comment has been minimized.
This comment has been minimized.
But magically, on the exact same VPS, the exact same file doesnt block the event loop while sending out on my upcoming lib |
Irrelevant, threaded I/O is a major selling point of Node. @gamer0mega can you provide a (somewhat minimal) repro script? Eris shouldn't be using sync APIs for network I/O, so something is being overlooked here. |
fs.readFile("video.mp4", ((err, buf) => msg.channel.createMessage("", {file: buf, name: "vid.mp4"}))); You can get the video at https://media.discordapp.net/attachments/795468742670417971/929560222249410642/vid.mp4 Here is a demo: https://media.discordapp.net/attachments/795468742670417971/929560623145173002/Screen_Recording_20220109-052052_Discord-Canary.mp4 |
It seems your issue is that the ping message is delayed until after the file message? That is the ratelimiter system working as designed: requests in one route are sent sequentially, but without blocking the event loop or other routes. Try sending the two messages in different channels (different ratelimit routes), and they shouldn't be blocking each other if there aren't any other bottlenecks. |
There you go, The file is too big so i can show you from other channels. On my main bot i use a fork from DonovanDMC(0.16.0-dev) which i didnt update yet, and sending the exact same spongebob video is almost 3 times slower, I am unsure if thats an issue with the event count or the eris version. |
I am having issues with sending large attachments, they simply block the entire event loop until the attachment is sent.
I couldn't find the cause inside the RequestHandler, sending a 4MB video file is enough to block the loop for a few seconds.
Once I returned client in a function and used it in a eval, I had to restart the process just because the output file was never sent and the loop was completely blocked.
I am running [email protected] (git+ssh://[email protected]/abalabahaha/eris.git#1a6e043331aea04de307a71d2e50e9680d1a5ae3)
The text was updated successfully, but these errors were encountered: