Skip to content

Commit

Permalink
troubleshooting: raise on failing pids
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaddell committed Jun 14, 2024
1 parent 009263c commit 1e3f21a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
kubernetes_template_rendering (0.2.1.pre.dc.2)
kubernetes_template_rendering (0.2.1.pre.dc.3)
activesupport
invoca-utils
jsonnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def render(args)
else
# this is the child
render_set(args, resource_set)
Kernel.exit!(3) # skip at_exit handlers since parent will run those
Kernel.exit!(0) # skip at_exit handlers since parent will run those
end
else
render_set(args, resource_set)
Expand Down Expand Up @@ -72,7 +72,8 @@ def wait_if_max_forked(child_pids)
rescue SystemCallError # this will happen if they all exited before we called waitpid
end
child_pids.delete_if do |pid|
Process.waitpid(pid, Process::WNOHANG)
[_, exit_status] = Process.waitpid2(pid, Process::WNOHANG)
exit_status.success? or raise "Child process #{pid} failed"
rescue Errno::ECHILD # No child processes
true
end
Expand Down
2 changes: 1 addition & 1 deletion lib/kubernetes_template_rendering/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module KubernetesTemplateRendering
VERSION = "0.2.1.pre.dc.2"
VERSION = "0.2.1.pre.dc.3"
end

0 comments on commit 1e3f21a

Please sign in to comment.