Reqwest hangs after a particular number of requests #1610
-
I'm running into application hangs after a fixed number of requests (count varies between machines, but seems fixed on each). In particular, it only seems to happen when I use The problem can be reproduced using the code in this gist. As indicated above, if I change lines 15 and 16 to use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Don't use |
Beta Was this translation helpful? Give feedback.
-
@seanmonstar thank you, this whole thing was apparently a big lack of understanding on my part about how to introduce async functionality into a previously synchronous project; this issue forced me to get to understand async runtimes a bit better, and switching from the use of futures to the tokio runtime was the fix. |
Beta Was this translation helpful? Give feedback.
Don't use
block_on
from futures. It will park the thread in a way that doesn't allow Tokio's IO driver to do anything. It's also possible the number you're see is Tokio's cooperative budget not being able to replenish.