Skip to content

[DocDB] Thread pool worker could miss added task #27898

Open
@spolitov

Description

@spolitov

Jira Link: DB-17504

Description

When a thread pool worker becomes idle, it follows these steps:

  1. Checks the task queue
  2. Adds itself to the waiting workers list
  3. Waits on a condition variable for new work

However, a race condition can occur if a task is added to the queue immediately after the worker checks it but before it begins waiting. This results in:

  • The worker waiting on the condition variable
  • While the task queue is non-empty (causing a potential deadlock)

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions