Skip to content

calling futures::executor::block_on in block_in_place may hang #2603

@leoyvens

Description

@leoyvens

Version
0.2.21

Platform
Linux

Description
I'm basically having the problem in this issue #2376, which is to use block_on within a tokio task, and sometimes it hangs. This comment #2376 (comment) says using spawn_blocking fixes it. I figured block_in_place should also work, but it didn't. A guess for why is that when using block_in_place the thread local variable for the task budget continues to decrease, when it should stop counting. Possibly as was done for LocalSet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-questionUser questions that are neither feature requests nor bug reportsM-taskModule: tokio/task

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions