Skip to content

Thread Pool Deadlock While Task Wait #1040

@COM8

Description

@COM8

Description

There are potential cases where a cpr::ThreadPool can get stuck in a potential deadlock. They are both caused by a race condition involving task_cond.

It can happen that a thread gets stuck waiting for task_cond to get notified but during this there is no one who can notify him like if the caller invokes cpr::ThreadPool::Wait().

Example/How to Reproduce

Run the currently disabled ThreadPoolTests from within #1035 over and over again. From time to time they will get stuck.

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

Fedora 38, #1035

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions