-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Freeze or dup global state data structures #5060
Comments
@cassianoleal are you able to provide debug output or any additional information? I'm not familiar with the inner workings of either of those plugins, so the possibilities for collision are endless... |
Sure thing -- https://gist.github.com/Yserz/96ce0cd7e478a5b57dba I couldn't find any useful information there though, and @Yserz was able to pinpoint the issue and monkey patch a fix through trial and error. As far as I can tell, both my fix for Vagrant-Butcher and the monkey patch he applied on Vagrant-Cachier deal only with locally scoped variables and methods and should not have interfered with each other. It's easy to reproduce the issue as well:
|
Are you potentially hitting this change? Example fix: https://github.com/berkshelf/vagrant-berkshelf/blob/cd5ee78f28ee9f6bec1b72fcdbcb042b0155aa04/lib/vagrant-berkshelf/helpers.rb#L77-L86 |
Yes, hence the fix mentioned in the OP. That doesn't explain why cachier's lack of a fix interferes with butcher. |
@cassianoleal I believe the problem here is the use of
As you can see, Vagrant cachier should use @mitchellh do you think we should /cc @fgrehm |
Using [Array#keep_if](http://www.ruby-doc.org/core-1.9.3/Array.html#method-i-keep_if) on a Vagrant core object can lead to unpredictable behaviour down the line as it modifies the object instead of creating a new one. An example of such interference is described on c10l/vagrant-butcher#57. The problem with `keep_if` was identified by @sethvargo on this issue: hashicorp/vagrant#5060 (comment)
I guess you're right. I've opened a pull request on vagrant-cachier to replace Thanks for your help, I'll close this issue now. :) |
@cassianoleal I'm going to re-open this. There's still a "bug" here in the sense that we need to freeze or dup these mutable data structures. |
Fair enough! :) |
I'd say we'll keep this a plugin issue. It is quite rare this happens and it would be hard to track down every mutable data structure. Let's just solve it on per-issue basis. |
For some reason, two plugins are interfering with each other in a very odd manner.
Vagrant-Butcher has a method to check whether a chef-client provisioner is running as it's only relevant if so.
Vagrant-Cachier uses a similar method to learn if it needs to cache Chef cookbooks.
Vagrant has recently (I reckon on 1.7.0) made changes to that object and a fix was put in place on Butcher, but Cachier hasn't been fixed yet.
Now, for some reason, if you have both plugins installed, Butcher never does anything. Uninstalling Cachier "fixes" the problem.
More information on this bug report: c10l/vagrant-butcher#57
I reckon the internals of one plugin should not interfere on the internals of another, and I have no idea why this is happening.
Thanks!
The text was updated successfully, but these errors were encountered: