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

Long running commands cause Discord MESSAGE_CREATED event timeouts #12

Open
Soyvolon opened this issue Jan 20, 2021 · 2 comments
Open
Labels
bug Something isn't working
Projects
Milestone

Comments

@Soyvolon
Copy link
Contributor

Soyvolon commented Jan 20, 2021

info: System.Net.Http.HttpClient.ApiClient.ClientHandler[100]
      Sending HTTP request GET https://api.faforever.com/data/game?include=mapVersion,playerStats,mapVersion.map,playerStats.player,featuredMod,playerStats.player.globalRating,playerStats.player.ladder1v1Rating,playerStats.player.clanMembership.clan&filter=playerStats.player.login==Soyvolon
[2021-01-20 18:01:50 -05:00] [104 /EventHandler] [Error] Event handler exception for event MESSAGE_CREATED thrown from System.Threading.Tasks.Task QMmands_MessageCreated(DSharpPlus.DiscordClient, DSharpPlus.EventArgs.MessageCreateEventArgs) (defined in Faforever.Qai.Discord.DiscordBot)
Emzi0767.Utilities.AsyncEventTimeoutException`2[DSharpPlus.DiscordClient,DSharpPlus.EventArgs.MessageCreateEventArgs]: An event handler caused the invocation of an asynchronous event to time out.
[2021-01-20 18:01:50 -05:00] [104 /EventHandler] [Error] Event handler exception for event MESSAGE_CREATED thrown from System.Threading.Tasks.Task Client_MessageCreated(DSharpPlus.DiscordClient, DSharpPlus.EventArgs.MessageCreateEventArgs) (defined in DSharpPlus.DiscordShardedClient)
Emzi0767.Utilities.AsyncEventTimeoutException`2[DSharpPlus.DiscordClient,DSharpPlus.EventArgs.MessageCreateEventArgs]: An event handler caused the invocation of an asynchronous event to time out.

Command still executes properly, but the command handler errors.

This is caused by long running command pausing the event handlers, when the commands should be running elsewhere. Code needs to be refactored for the Discord MESSAGE_CREATED event handling

@chrsin
Copy link
Contributor

chrsin commented Jan 26, 2021

Is this still an issue? Cause I fixed an issue with the clan parsing

@Soyvolon
Copy link
Contributor Author

Soyvolon commented Jan 27, 2021

No it is still a problem, but that's mainly because the commands are for some reason holding up the event handler. Which means I need to go refactor that to prevent timeouts on long running commands.

@Soyvolon Soyvolon changed the title Errors throw in logs when some API commands are used. Long running commands cause Discord MESSAGE_CREATED event timeouts Jan 27, 2021
@Soyvolon Soyvolon added the bug Something isn't working label Jan 28, 2021
@Soyvolon Soyvolon added this to the 1.0 Bugs milestone Jan 28, 2021
@Soyvolon Soyvolon added this to To do in 1.0 Release via automation Jan 28, 2021
@Crotalus Crotalus moved this from To do to Done in 1.0 Release Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants