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

fix: Protect codersdk.Client SessionToken so it can be updated #4965

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Nov 9, 2022

This feature is used by the coder agent to exchange a new token. By
protecting the SessionToken via mutex we ensure there are no data races
when accessing it.

This race can be seen here: https://github.com/coder/coder/actions/runs/3427027452/jobs/5709526632

@mafredri mafredri self-assigned this Nov 9, 2022
@mafredri mafredri requested a review from a team November 9, 2022 11:01
This feature is used by the coder agent to exchange a new token. By
protecting the SessionToken via mutex we ensure there are no data races
when accessing it.
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oofta this was a race I caused 🤦‍♂️. Thank you for fixing!

@mafredri mafredri merged commit 26ab0d3 into main Nov 9, 2022
@mafredri mafredri deleted the mafredri/session-token-race branch November 9, 2022 13:31
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants