Skip to content

Likely concurrency bug/deadlock in ParkingSpot #7623

@alexcrichton

Description

@alexcrichton

This GitHub Actions failure happened on the 15.0.0 release branch yesterday. The bug there appears to be a timeout in the builder where the log ends with:

...
test parking_spot::tests::parking_lot::unpark_one_one_fast ... ok
test parking_spot::tests::parking_lot::unpark_all_one_fast ... ok
test parking_spot::tests::atomic_wait_notify has been running for over 60 seconds
Error: The operation was canceled.

In the absence of any other information this appears like the atomic_wait_notify test deadlocked and then the test timed out eventually when GitHub Actions let it run for 6 hours.

I've been staring at the test and the implementation of ParkingSpot and I unfortunately haven't been able to come up with anything.

One thing I have noticed is that blocking is done with Rust's standard Condvar which is documented as allowing possible spurious wakeups. This I think means that a thread can "steal" a wakeup notification meant for another. I haven't been able to construct a theoretical trace which leads to deadlock however. Additionally I can't say with any certainty that this is an actual issue since the precise concurrent behaviors allowed here I'm not certain of.

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