Menu

#2073 addWaitingApiActivity() increments waitingAccess and sets waitingForDispatch without queueing

5.3.0
open
nobody
None
none
5
2026-07-25
2026-07-25
No

ActivityManager::addWaitingApiActivity() (ActivityManager.cpp:258) bumps the waiter counters and
marks the activity as waiting for dispatch, but never pushes it onto waitingActivities:

waitingAccess++;
waitingApiAccess++;
waitingAct->setWaitingForDispatch(); // claims to be in the dispatch queue
yieldCurrentActivity();
lock.release(); // no push_back anywhere in this function

Compare addWaitingActivity(), which does waitingActivities.push_back(waitingAct).

So waitingAccess and the actual queue length can diverge. hasWaiters()
(ActivityManager.hpp:67) is waitingAccess != 0 || waitingAttaches != 0, and both
returnActivity() and suspendDispatch() branch on isWaitingForDispatch() to decide whether to
pop or erase queue entries — entries that may belong to a different activity.

Observed directly with tracing: long runs of waitingAccess == 2 while the queue size is 0.

I do not know the intended design well enough to propose a fix — either the counter should not be
incremented on this path, or the flag should not be set, or the activity should genuinely be queued.

Discussion

Anonymous
Anonymous

Add attachments
Cancel