Skip to content

max_blocking_threads documentation should perhaps indicate that Tokio internally uses those too #5777

@krallin

Description

@krallin

Version

1.25.0

Platform

Windows, any version

Description

As written, the documentation for max_blocking_threads suggests it's only used for

This probably warrants a small disclaimer that setting this low-ish may be a good idea. In particular, on Windows, reading a pipe is a blocking read and will take away a blocking thread forever.

If you set max_blocking_threads to a low value (e.g. in our case, in a test, we were setting it to 2), you can easily find yourself in a situation where spawn_blocking just hangs forever, because all your blocking threads are waiting on a pair of idle pipes (stdout and stderr of a child process, in our case), which might be rather unexpected!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-bugCategory: This is a bug.M-runtimeModule: tokio/runtimeT-docsTopic: documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions