Skip to content

Conversation

@cmetz100
Copy link
Contributor

@cmetz100 cmetz100 commented Jan 30, 2026

What does this PR do?

Fixes a rare race condition in signal_and_wait that loom does not catch (without adding an explicit yield point)

Motivation

Fix race condition.

Additional Notes

The first commit adds the loom tests to prove that 1. we have a race condition, and 2. loom is unable to explore the right interleaving without an explicit yield point

The second commit applied the fix

If you checkout the first commit expect the loom test signal_and_wait_race_proof_with_yeild to fail

Here is my writeup. It has a lot more context and details

https://datadoghq.atlassian.net/wiki/x/dwBHcAE

@cmetz100 cmetz100 force-pushed the cmetz/signal_and_wait_race_fix branch from 577f5ba to 29f09a2 Compare February 2, 2026 20:04
Signed-off-by: Caleb Metz <caleb.metz@datadoghq.com>
Signed-off-by: Caleb Metz <caleb.metz@datadoghq.com>
Signed-off-by: Caleb Metz <caleb.metz@datadoghq.com>
@cmetz100 cmetz100 force-pushed the cmetz/signal_and_wait_race_fix branch from 841329d to cef2e7f Compare February 4, 2026 16:38
@cmetz100 cmetz100 marked this pull request as ready for review February 4, 2026 18:23
@cmetz100 cmetz100 requested a review from a team as a code owner February 4, 2026 18:23
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.

2 participants