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

(GH-1083) Bump childprocess to '~> 4.0.0'; Disable @process.leader #1084

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/pdk/cli/exec/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ def initialize(*argv)
@argv = argv

@process = ChildProcess.build(*@argv)
@process.leader = true
# https://github.com/puppetlabs/pdk/issues/1083:
# When @process.leader is set, childprocess will set the CREATE_BREAKAWAY_FROM_JOB
# and JOB_OBJECT_LIMIT_BREAKAWAY_OK flags in the Win32 API calls. This will cause
# issues on systems > Windows 7 / Server 2008, if the JOB_OBJECT_LIMIT_BREAKAWAY_OK
# flag is set and the Task Scheduler is trying to kick off a job, it can sometimes
# result in ACCESS_DENIED being returned by the Win32 API, depending on the permission
# levels / user account this user.
# The resolution for pdk/issues/1083 is to ensure @process.leader is not set.
# This will potentially cause issues on older Windows systems, in which case we may
# need to revisit and conditionally set this param depending on what OS we're on
# @process.leader = true

@stdout = Tempfile.new('stdout', mode: TEMPFILE_MODE).tap { |io| io.sync = true }
@stderr = Tempfile.new('stderr', mode: TEMPFILE_MODE).tap { |io| io.sync = true }
Expand Down
4 changes: 2 additions & 2 deletions pdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.4.0' # rubocop:disable Gemspec/RequiredRubyVersion

spec.add_runtime_dependency 'bundler', '>= 1.15.0', '< 3.0.0'
spec.add_runtime_dependency 'childprocess', '~> 0.7.1'
spec.add_runtime_dependency 'childprocess', '~> 4.0.0'
spec.add_runtime_dependency 'cri', '~> 2.10'
spec.add_runtime_dependency 'diff-lcs', '1.3'
spec.add_runtime_dependency 'ffi', '>= 1.9.25', '< 2.0.0'
spec.add_runtime_dependency 'gettext-setup', '~> 0.24'
spec.add_runtime_dependency 'hitimes', '1.3.0'
spec.add_runtime_dependency 'hitimes', '2.0.0'
spec.add_runtime_dependency 'json-schema', '2.8.0'
spec.add_runtime_dependency 'json_pure', '~> 2.1.0'
spec.add_runtime_dependency 'minitar', '~> 0.6'
Expand Down