-
Notifications
You must be signed in to change notification settings - Fork 2.2k
(maint) Reset "tasks" setting after with_script_compiler #7822
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
(maint) Reset "tasks" setting after with_script_compiler #7822
Conversation
CLA signed by all contributors. |
@pcarlisle Are there any ramifications w/r/t thread-safety with this? |
This #7746 & this #7745 represent two different approaches for making this setting threadsafe, this PR doesn't harm either approach (though it would cause a rebase conflict with one it isn't difficult to figure out the correct behavior). This is a correctness thing and, iirc, parallels what Maggie did to |
Not sure what's up with that test failure, something weird with that. @nicklewis does someone from the bolt team want to review and merge? |
close/reopen to kick travis |
@nicklewis looks like you might need to just close and open a new PR entirely, Travis is still confused :( |
The `Puppet::Pal.with_script_compiler` method sets the `Puppet[:tasks]` setting to true for the duration of the block, but never sets it back to its original state. This means that the mode of operation the process is in will be globally changed depending on whether this method has been called. The corresponding `with_catalog_compiler` method has similar behavior in setting `Puppet[:tasks]` to false, but it ensures that the setting is reset to its previous value when the method returns. We now copy that behavior in `with_script_compiler`.
ab21af9
to
c2e2aaf
Compare
Travis is green now. |
The
Puppet::Pal.with_script_compiler
method sets thePuppet[:tasks]
setting to true for the duration of the block, butnever sets it back to its original state. This means that the mode of
operation the process is in will be globally changed depending on
whether this method has been called. The corresponding
with_catalog_compiler
method has similar behavior in settingPuppet[:tasks]
to false, but it ensures that the setting is reset toits previous value when the method returns. We now copy that behavior in
with_script_compiler
.