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

MbedTLS compatibility #9

Closed
christopher-dG opened this issue Nov 2, 2018 · 4 comments
Closed

MbedTLS compatibility #9

christopher-dG opened this issue Nov 2, 2018 · 4 comments

Comments

@christopher-dG
Copy link
Collaborator

christopher-dG commented Nov 2, 2018

TLDR: HTTP requests don't work properly on MbedTLS 0.6.3, and the gateway connection doesn't work properly on newer versions.

With code like this:

julia> c = Client("token"); ch = retrieve(DiscordChannel, c, 1234567890);
julia> fs = map(i -> create(Message, c, ch; content=i), 1:50);

It's somewhat common to see a deadlock where one request grabs the rate limiter bucket lock and makes the request, then hangs, which holds up all the other requests. I've seen the requests go though after a few minutes of waiting which is weird (and I've confirmed that Discord's rate limiting has nothing to do with it).
The really weird bit is that the request actually does reach Discord, i.e. a message is created, but the request still doesn't return. So I'm inclined to think that this could be a bug with HTTP.jl.

@Xh4H
Copy link
Owner

Xh4H commented Nov 2, 2018

Should probably open an issue in HTTP.jl to make sure it's not a problem from our side.

@christopher-dG
Copy link
Collaborator Author

👍 I just want to get rid of any possibility that it's my own bug in the synchronization first.

@christopher-dG
Copy link
Collaborator Author

Okay so we have a bit of a dilemma:
The problem here is caused by MbedTLS at 0.6.3. The latest version is 0.6.5, and the requests return consistently on that version. But the reason we're at 0.6.3 is that newer versions have an issue with the gateway that basically causes events to constantly lag behind by one. For example, if I start typing in a channel, you don't receive a TypingStart until I send the message. Then when I start typing again, you get the MessageCreate that you should have gotten before, and so on.
I'll try to put together a bug report for MbedTLS, and keep trying different versions in the meantime.

@christopher-dG christopher-dG changed the title HTTP request + rate limiter deadlocks sometimes MbedTLS compatibility Nov 2, 2018
@christopher-dG
Copy link
Collaborator Author

Filed JuliaLang/MbedTLS.jl#186

@christopher-dG christopher-dG mentioned this issue Nov 2, 2018
14 tasks
christopher-dG added a commit that referenced this issue Nov 3, 2018
christopher-dG added a commit that referenced this issue Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants