-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
High cpu usage on long requests. #348
Comments
Thanks for filing an issue, this definitely doesn't sound like intended behavior! I'll look into this as soon as I am able. Here are some things that might help me in preparation:
|
This example was tested on macOS 11.5.2 with async-std 1.10.0. |
I can't admit to fully understanding what's going on here, the interface with curl's multi client is pretty confusing, but it seems that isahc's timer is not behaving as curl expects. The timer provided by curl should be fired only once and not repeat (https://github.com/alexcrichton/curl-rust/blob/master/src/multi.rs#L207-L225), and does not seem to be explicitly cleared via the Before:After: |
That's excellent detective work @jacobmischka, thanks for taking the time to look into it! Your analysis looks sound, and I'll be sure to get your fix into a release soon. This is for sure a regression from when we switched from using curl's provided I/O selector to our own, since previously curl was managing the timers on our behalf (and presumably clearing the timer properly after it expires).
This is a good reminder for me to expand the documentation on Isahc's internals. Basically we're using the most advanced version of the multi interface described in Drive with multi_socket and using |
After the timer "fires" once, we must clear it ourselves, curl does not clear it for us using the callback after calling `action`, only when it changes. After our curl-provided timeout has expired, fall back to our default timeout, or else we continue polling in a loop. Closes #348
This is now fixed in the 1.5.1 release! |
Hello! Starting from 1.2 version this simple program consumes almost 50% of one cpu.
On 1.1 version it works fine.
The text was updated successfully, but these errors were encountered: