Skip to content

fix(NotificationQueue): wakeUpAll() lost-wakeup race causes deadlock …#5214

Open
aleks-f wants to merge 3 commits intomainfrom
5213-nq-deadlock
Open

fix(NotificationQueue): wakeUpAll() lost-wakeup race causes deadlock …#5214
aleks-f wants to merge 3 commits intomainfrom
5213-nq-deadlock

Conversation

@aleks-f
Copy link
Member

@aleks-f aleks-f commented Feb 17, 2026

…on shutdown #5213

@aleks-f aleks-f added this to the Release 1.15.1 milestone Feb 17, 2026
@aleks-f aleks-f self-assigned this Feb 17, 2026
@aleks-f aleks-f added the bug label Feb 17, 2026
@aleks-f aleks-f requested a review from Copilot February 17, 2026 15:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a shutdown-time deadlock in NotificationQueue by preventing a lost-wakeup race when wakeUpAll() happens before threads enter waitDequeueNotification().

Changes:

  • Add _wokeUp state so waitDequeueNotification() can return immediately if a prior wakeUpAll() occurred.
  • Add a new regression test that reproduces the “wakeUpAll before wait” scenario.
  • Register the new test in the test suite.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
Foundation/testsuite/src/NotificationQueueTest.h Declares the new regression test.
Foundation/testsuite/src/NotificationQueueTest.cpp Implements and registers the regression test for the lost-wakeup scenario.
Foundation/src/NotificationQueue.cpp Makes waitDequeueNotification*() return nullptr if _wokeUp was set, and sets _wokeUp in wakeUpAll().
Foundation/include/Poco/NotificationQueue.h Adds _wokeUp member to persist wakeup state across calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 23 to 24


Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::move is used later in this file, but <utility> is not included. Please add #include <utility> to ensure the file compiles portably without relying on transitive includes.

Suggested change
#include <utility>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NotificationQueue::wakeUpAll() lost-wakeup race causes deadlock on shutdown

1 participant

Comments