-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Change max_threads
to max_blocking_threads
#2802
Comments
We should be able to look at this as part of #2720. |
I discovered this the hard way yesterday 😭 |
@carllerche Should we disallow this configuration as part of v1? |
We could make |
Those semantic changes seem fine (though I'm not sure necessary). I request that it remains allowed that |
I think that with the semantic change that @carllerche suggests, it is fine to allow it to be configured to zero. |
How hard would an assert or panic be to add on the call to |
In a use case of mine, I don't want to implicitly be using |
That doesn't sound too bad. One point to consider is whether it should panic on spawn, or just return a |
Either is fine by me. I don't have a strong preference. I'd hope in the latter case, something might log or be passed back up through any APIs using |
max_threads
to max_blocking_threads
#3287 just panics on |
Hey folks: just to confirm (because it's not quite clear from the docs): are these the semantics that |
Yes, that should be correct.f |
Version
└── tokio v0.2.22
Platform
Linux notebook 5.8.5-arch1-1 #1 SMP PREEMPT Thu, 27 Aug 2020 18:53:02 +0000 x86_64 GNU/Linux
Description
On a runtime with the same number of
core_threads
asmax_thread
executingtokio::task::spawn_blocking
will produce a future that never completes. For example:Playground
Output:
I am not sure that this behavior is desired. Maybe requiring
core_threads
<max_threads
instead ofcore_threads
≤max_threads
or panicking or immediately returning an error intokio::task::spawn_blocking
would be better?The text was updated successfully, but these errors were encountered: