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

core: Make copies when creating destroy nodes #5026

Merged
merged 1 commit into from
Feb 9, 2016

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Feb 5, 2016

Fixes an interpolation race that was occurring when a tainted destroy
node and a primary destroy node both tried to interpolate a computed
count in their config. Since they were sharing a pointer to the same
config, depending on how the race played out one of them could catch the
config uninterpolated and would then throw a syntax error.

The Copy() tree implemented for this fix can probably be used
elsewhere - basically we should copy the config whenever we drop nodes
into the graph - but for now I'm just applying it to the place that
fixes this bug.

Fixes #4982

@phinze
Copy link
Contributor Author

phinze commented Feb 5, 2016

Added a test covering the race condition.

Ping @mitchellh for review on the golang-isms here. 👀

@mitchellh
Copy link
Contributor

LGTM. You may want to test Resource.Copy.

I also will take a look at why copystructure doesn't work here (it doesn't), because we should probably use that for simplicity. But Merge this for now!

Fixes an interpolation race that was occurring when a tainted destroy
node and a primary destroy node both tried to interpolate a computed
count in their config. Since they were sharing a pointer to the _same_
config, depending on how the race played out one of them could catch the
config uninterpolated and would then throw a syntax error.

The `Copy()` tree implemented for this fix can probably be used
elsewhere - basically we should copy the config whenever we drop nodes
into the graph - but for now I'm just applying it to the place that
fixes this bug.

Fixes #4982 - Includes a test covering that race condition.
@phinze
Copy link
Contributor Author

phinze commented Feb 9, 2016

Okay Resource.Copy exercised by unit tests now, which flushed out a couple of details in the copy.

phinze added a commit that referenced this pull request Feb 9, 2016
core: Make copies when creating destroy nodes
@phinze phinze merged commit 9a00675 into master Feb 9, 2016
@phinze phinze deleted the phinze/destroy-node-copies branch February 9, 2016 17:12
@ghost
Copy link

ghost commented Apr 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seemingly random parse failures
2 participants