Skip to content

Race condition in tutorial code example on website #842

@32h8

Description

@32h8

So I think i found a race condition in code example in tutorial.
In this tutorial section there is implementation of Delay future.
The issue occurs when the Delay future migrates across tasks while it executes. Basically, the spawned thread calls wake on an old Waker, and the task gets stuck at await point.

I created a repo with example tweaked to show race condition: repo

I also noticed the webiste links to other Delay implementation that is different than one displayed on website. The issue doesn't occur in that implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions