Skip to content

DPL: keep the run loop going until in-flight streams finish - #16282

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16282
Open

ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16282

Conversation

@ktf

@ktf ktf commented Dec 4, 2026

Copy link
Copy Markdown
Member

With DPL_THREADPOOL_SIZE>0 the device loop hands doRun to the uv pool and then
returns from Run() without waiting for it, so FairMQ tears the channels down
while a worker is still inside a send and the channel is reached through a
dangling pointer -- instrumenting the failing send showed index=0 of 1 output
channel and a sane proxy, but IsValid() false and a name of garbage bytes. Keep
looping while a stream is running rather than blocking after the loop: the
transition expires in the middle of the body and what follows it still matters
to a stream which is finishing, in particular draining the asynchronous queue,
which is how the oldest possible timeslice goes out. Stop scheduling new work
once the transition has expired, since we are only draining by then.
stream.running is set when the work is queued and cleared by run_completion,
both on the loop thread, so none of this needs atomics. On
o2-test-framework-SimpleDataProcessingDevice01, 20 runs at
DPL_THREADPOOL_SIZE=1: 8/20 passing to 16/20.

With DPL_THREADPOOL_SIZE>0 the device loop hands doRun to the uv pool and then
returns from Run() without waiting for it, so FairMQ tears the channels down
while a worker is still inside a send and the channel is reached through a
dangling pointer -- instrumenting the failing send showed index=0 of 1 output
channel and a sane proxy, but IsValid() false and a name of garbage bytes. Keep
looping while a stream is running rather than blocking after the loop: the
transition expires in the middle of the body and what follows it still matters
to a stream which is finishing, in particular draining the asynchronous queue,
which is how the oldest possible timeslice goes out. Stop scheduling new work
once the transition has expired, since we are only draining by then.
stream.running is set when the work is queued and cleared by run_completion,
both on the loop thread, so none of this needs atomics. On
o2-test-framework-SimpleDataProcessingDevice01, 20 runs at
DPL_THREADPOOL_SIZE=1: 8/20 passing to 16/20.
@ktf
ktf requested a review from a team as a code owner December 4, 2026 12:58

This branch has not been deployed

No deployments
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