Skip to content

DPL: process the stats commands in the order of their timestamps - #16256

Merged
ktf merged 2 commits into
AliceO2Group:devfrom
ktf:pr16256
Dec 2, 2026
Merged

ktf merged 2 commits into
AliceO2Group:devfrom
ktf:pr16256

Conversation

@ktf

@ktf ktf commented Dec 2, 2026

Copy link
Copy Markdown
Member

processCommandQueue sorts the indices of the queued commands by timestamp, as
the comment says, so that a command is applied after those which happened
before it, but then walks the queue in insertion order, ignoring the sort.
Within one thread the two orders are the same, since the timestamps come from
the loop's clock. Across threads they are not: a command can take its slot
before another and read the clock after it. A Set then came after an Add which
happened later, saw the Add's timestamp as newer and was dropped. Walk the
sorted order. DataProcessingStatsOutOfOrder now checks that case.

ktf added 2 commits December 2, 2026 10:23
flushChangedMetrics runs on the loop. It reads metrics and reads and resets
updated and updateInfos, which a pool thread flushing the command queue writes
at the same time under flushMutex. Take the same mutex. Nothing it calls goes
back to updateStats or processCommandQueue: the callback only formats the
metric and hands it to Monitoring, whose DPL backend queues it for the driver.
processCommandQueue sorts the indices of the queued commands by timestamp, as
the comment says, so that a command is applied after those which happened
before it, but then walks the queue in insertion order, ignoring the sort.
Within one thread the two orders are the same, since the timestamps come from
the loop's clock. Across threads they are not: a command can take its slot
before another and read the clock after it. A Set then came after an Add which
happened later, saw the Add's timestamp as newer and was dropped. Walk the
sorted order. DataProcessingStatsOutOfOrder now checks that case.
@ktf
ktf requested a review from a team as a code owner December 2, 2026 09:29
@ktf
ktf merged commit 7011840 into AliceO2Group:dev Dec 2, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant