]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_queue: fix double increment of member->calls with shared_lastcall
authorsmtcbn <samet109.06@gmail.com>
Fri, 23 Jan 2026 14:31:44 +0000 (17:31 +0300)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 1 Jun 2026 15:23:26 +0000 (15:23 +0000)
commit209f8f012e83e079eef6663aac6496337c8ba4fe
tree5b3f07765db94cc48ece74b7a542f59694330bda
parent09aa56ae002145dd0a958cf9b5720973a26fd7f9
app_queue: fix double increment of member->calls with shared_lastcall

Under high concurrency, update_queue() may be invoked multiple times
for the same call, causing member->calls and queue-level counters to
be incremented more than once.

The existing starttime check is not atomic and allows concurrent
execution paths to pass. Treat member->starttime as a single-use token
and consume it via CAS to ensure the call is counted exactly once.

This also prevents incorrect call distribution when using strategies
such as fewestcalls.

Observed as a regression after upgrading to 20.17.

Resolves: #1736
apps/app_queue.c