Replies: 1 comment 2 replies
-
If you're not If some parts of your HTTP service issue blocking syscalls, the solution is to move those parts out to be executed in blocking threads, not move the entire HTTP service into a blocking thread. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I want to run axum on a blocking dedicated thread using tokio's
task::spawn_blocking
, and I have other async tasks which I run withspawn
. I want the tasks spawned using the normalspawn
to run on a thread which is not the same thread as the axum http task, because the http task is IO-heavy and executes a number of syscalls. Before I refactored the code to spawn the http task as blocking, the http task would sometimes be scheduled on the same thread as the other tasks, which would cause them to hang until the http task is done answering an HTTP request.My problem is that currently the HTTP task does not respond to HTTP requests (http requests hang).
Does anyone have a clue why it's happening?
My setup is as following:
axum version
0.7.9
Beta Was this translation helpful? Give feedback.
All reactions