You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux sync-z2 4.15.0-162-generic #170-Ubuntu SMP Mon Oct 18 11:38:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Description
The documentation for the function Builder::worker_threads states that if it is used
with current_thread runtime it will panic. However it doesn't panic, it appears to
ignore the value set by the call instead.
Additionally, the documentation for worker_threads contains 2 panic sections.
The other panic section describes a case that does panic (val = 0).
The 2 options I see here are:
Leave the functionality as it is (silently ignore worker_threads for a current_thread runtime) and fix the documentation
Change the functionality so that it does panic (ideally directly within worker_threads itself) and also fix the documentation so that all panics are described in a single heading
I would lean towards option 1 as this makes it easier to choose the runtime Kind in the builder at execution time. It will also not break any existing code.
The text was updated successfully, but these errors were encountered:
The documentation for the runtime `Builder::worker_threads` function
incorrectly stated that it would panic if used when constructing a
`current_thread` runtime. In truth, the call to the function has no
effect.
Since adding the described panic to the code could cause new panics in
existing code using tokio, the documentation has been modified to
describe the existing behavior.
Refs: tokio-rs#4773
The documentation for the runtime `Builder::worker_threads` function
incorrectly stated that it would panic if used when constructing a
`current_thread` runtime. In truth, the call to the function has no
effect.
Since adding the described panic to the code could cause new panics in
existing code using tokio, the documentation has been modified to
describe the existing behavior.
Refs: #4773
Version
tokio v1.19.2 (also master branch)
Platform
Linux sync-z2 4.15.0-162-generic #170-Ubuntu SMP Mon Oct 18 11:38:05 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Description
The documentation for the function
Builder::worker_threads
states that if it is usedwith
current_thread
runtime it will panic. However it doesn't panic, it appears toignore the value set by the call instead.
Documentation:
https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html#method.worker_threads
This test demonstrates the behaviour (it would live in
tokio/tests
):The test fails as nothing panics.
Additionally, the documentation for
worker_threads
contains 2 panic sections.The other panic section describes a case that does panic (
val = 0
).The 2 options I see here are:
worker_threads
for acurrent_thread
runtime) and fix the documentationworker_threads
itself) and also fix the documentation so that all panics are described in a single headingI would lean towards option 1 as this makes it easier to choose the runtime
Kind
in the builder at execution time. It will also not break any existing code.The text was updated successfully, but these errors were encountered: