Skip to content

Commit 1e3f21a

Browse files
committed
troubleshooting: raise on failing pids
1 parent 009263c commit 1e3f21a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
kubernetes_template_rendering (0.2.1.pre.dc.2)
4+
kubernetes_template_rendering (0.2.1.pre.dc.3)
55
activesupport
66
invoca-utils
77
jsonnet

lib/kubernetes_template_rendering/template_directory_renderer.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def render(args)
4040
else
4141
# this is the child
4242
render_set(args, resource_set)
43-
Kernel.exit!(3) # skip at_exit handlers since parent will run those
43+
Kernel.exit!(0) # skip at_exit handlers since parent will run those
4444
end
4545
else
4646
render_set(args, resource_set)
@@ -72,7 +72,8 @@ def wait_if_max_forked(child_pids)
7272
rescue SystemCallError # this will happen if they all exited before we called waitpid
7373
end
7474
child_pids.delete_if do |pid|
75-
Process.waitpid(pid, Process::WNOHANG)
75+
[_, exit_status] = Process.waitpid2(pid, Process::WNOHANG)
76+
exit_status.success? or raise "Child process #{pid} failed"
7677
rescue Errno::ECHILD # No child processes
7778
true
7879
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module KubernetesTemplateRendering
4-
VERSION = "0.2.1.pre.dc.2"
4+
VERSION = "0.2.1.pre.dc.3"
55
end

0 commit comments

Comments
 (0)