Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(agent/reconnectingpty): generate rpty id before starting lifecycle #15475

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

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

johnstcn
Copy link
Member

Fixes #12687

There was a race condition where we would start the rpty lifecycle before generating the ID, leading to a data race where we would try to concurrently read and write the struct field.

@johnstcn johnstcn requested a review from mafredri November 11, 2024 14:32
@johnstcn johnstcn self-assigned this Nov 11, 2024
@johnstcn johnstcn merged commit b6e7498 into main Nov 11, 2024
27 checks passed
@johnstcn johnstcn deleted the cj/agent-rpty-data-race branch November 11, 2024 15:02
johnstcn added a commit that referenced this pull request Nov 15, 2024
Fixes coder/internal#214

#15475 missed that we also write to `rpty` after starting
`rpty.lifecycle()`.
This PR moves the function call right at the end. Hopefully this should
address the data races before we go resorting to mutexes.
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.

flake: data race in scaletest/reconnectingpty Test_Runner/ExpectTimeout/NoTimeout
2 participants