Skip to content

Initialize stop-when's once-flag before the callbacks that use it - #2327

Merged
ericniebler merged 2 commits into
NVIDIA:mainfrom
workingBanana:fix/fused-token-once
Oct 13, 2026
Merged

ericniebler merged 2 commits into
NVIDIA:mainfrom
workingBanana:fix/fused-token-once

Conversation

@workingBanana

Copy link
Copy Markdown
Contributor

Fixes #2326

__fused_token::callback_type declared __called_ after __cb1_ and __cb2_.
If the first token is already stopped, __cb1_'s constructor invokes the
callback, which reads and sets __called_ before its lifetime begins; the
member initializer then stores false. Depending on the indeterminate
value, the stop is skipped (and lost if the second token never stops) or
the function runs a second time when the second token stops. The draft
requires it to run at most once ([exec.stop.when]).
Regression from 6720837 (NVIDIA#2234), which moved __called_ to the end.

Signed-off-by: Zhavoronkov Aleksei <a.zhavoronkov@adguard.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 5132851

@workingBanana

Copy link
Copy Markdown
Contributor Author

@ericniebler Could you please re-run CI so we can merge the PR?

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test df2c471

@workingBanana

workingBanana commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Not a test failure:

failed to connect to the docker API at npipe:////./pipe/docker_engine; check if the path is correct and if the daemon is running: open //./pipe/docker_engine: The system cannot find the file specified.
Error: Process completed with exit code 1.

On 5132851 this check passed.

@ericniebler
ericniebler merged commit b407057 into NVIDIA:main Oct 13, 2026
38 of 39 checks passed
@workingBanana
workingBanana deleted the fix/fused-token-once branch October 13, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stop-when: the fused token's callback can run twice, or be skipped, when the first token is already stopped

2 participants