Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cells: fix race condition between thread start and flag check #7742

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

kofemann
Copy link
Member

Motivation:

If newly started thread runs before running flag is set, then tunnel with shutdown instantly.

Thread-1: Create T2 --> | T2.start() | --> set running flag
Thread-2: | check flag; exit |

Modification:

set running before thread starts.

Result:
race is fixed

Issue: #5326
Acked-by: Paul Millar
Target: master, 10.2
Require-book: no
Require-notes: yes
(cherry picked from commit 2440b22)

Motivation:

If newly started thread runs before `running` flag is set, then tunnel
with shutdown instantly.

Thread-1: Create T2 -->  | T2.start()         | --> set running flag
Thread-2:                | check flag; exit   |

Modification:

set `running` before thread starts.

Result:
race is fixed

Issue: #5326
Acked-by: Paul Millar
Target: master, 10.2
Require-book: no
Require-notes: yes
(cherry picked from commit 2440b22)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
@mksahakyan mksahakyan merged commit 90984db into 10.2 Feb 1, 2025
3 checks passed
@mksahakyan mksahakyan deleted the fix-tunnel-race-10.2 branch February 1, 2025 12:05
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