-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 races in GetVariableValue and login #24599
Conversation
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I wouldn't object to another viewer
Thank you @jbardin ! For my education, --if you have time-- could you describe roughly how you were able to reproduce/identify the issue? I'm not too familiar with the TF code so it was tricky for me ( I swear I tried!) |
No problem @corentone, The most relevant portion of a stack trace is always the first stack. Since this is a fatal error and not a normal panic, it's coming out of the runtime and we don't have the corresponding read/write locations like we would from the race-detector, but it will show a map access somewhere. If you step back through the frames of that first stack, the first instance of terraform code you encounter is the I actually don't have a test fixture to trigger this at the moment, as any test configuration I have doesn't end up triggering the race. I have an idea to create a larger config that will, but since this bug is simple to visually inspect we can leave that for later, and try to fish out more of these in the long term with some fuzzing. Thanks for reporting it! |
@jbardin Do you think it would be posslbe to backport that to a patch version for the TF 0.12 branch somehow? I've heard reports of this impacting some people, and this is biting us also. Edit: It's done as per the commit below 🙇♂️ |
[Cherry-pick] Fix races in GetVariableValue and login #24599
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fix a few races that had crept into the codebase. Now that we've moved to a new CI system, we can probably start testing for these automatically, but there will still be some test fixtures that need updating.
GetVariableValue
was missing the variable mutex calls.login
command had a race around a closed-overerr
value.testHook
mock wasn't synchronized in the tests.wg.Wait()
caused a race in the deferred cleanup function.Fixes #24589