Jira (PUP-4433) Puppet doesn't process SIGCHLD

5 views
Skip to first unread message

Sergii Golovatiuk (JIRA)

unread,
Apr 17, 2015, 10:03:54 AM4/17/15
to puppe...@googlegroups.com
Sergii Golovatiuk created an issue
 
Puppet / Bug PUP-4433
Puppet doesn't process SIGCHLD
Issue Type: Bug Bug
Affects Versions: PUP 3.4.3
Assignee: Kylo Ginsberg
Components: Client
Created: 2015/04/17 7:03 AM
Priority: Normal Normal
Reporter: Sergii Golovatiuk

On some slow environments, there is a time between SIGCHLD and process termination. It leads to some issues as described at

https://bugs.launchpad.net/fuel/+bug/1444989

Puppet should verify SIGCHLD and make sure process actually ended and not zombied

Looking at util/execution.rb

if execution_stub = Puppet::Util::ExecutionStub.current_value
return execution_stub.call(*exec_args)
elsif Puppet.features.posix?
child_pid = execute_posix(*exec_args)
exit_status = Process.waitpid2(child_pid).last.exitstatus

Puppet code doesn't have any traps for sigchild to have any extra verifications if process zombied or stuck

trap(:CHLD) do
begin
while pid = Process.wait(-1, Process::WNOHANG)
exit if pid == child_pid
end
rescue Errno::ECHILD
end
end

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 17, 2017, 1:49:04 PM5/17/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Team: Agent
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 17, 2017, 1:49:04 PM5/17/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: triaged

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:55:39 PM5/18/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
May 1, 2018, 1:42:04 PM5/1/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
On some slow environments, there is a time between SIGCHLD and process termination. It leads to some issues as described at

https://bugs.launchpad.net/fuel/+bug/1444989

Puppet should verify SIGCHLD and make sure process actually ended and not zombied

Looking at util/execution.rb

{code:ruby}
    if execution_stub = Puppet::Util::ExecutionStub.current_value
      return execution_stub.call(*exec_args)
    elsif Puppet.features.posix?
      child_pid = execute_posix(*exec_args)
      exit_status = Process.waitpid2(child_pid).last.exitstatus
{code}

Puppet code doesn't have any traps for sigchild to have any extra verifications if process zombied or stuck

{code:ruby}
trap(:CHLD) do
  begin
    while pid = Process.wait(-1, Process::WNOHANG)
      exit if pid == child_pid
    end
  rescue Errno::ECHILD
  end
end

{code}
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jun 19, 2019, 2:07:03 PM6/19/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-4433
 
Re: Puppet doesn't process SIGCHLD

Since puppet fork/execs the child process and immediately waits after, the window of time for the zombie'd process is short. My understanding is that registering a signal handler for SIG_CHLD is only necessary if you want to ensure the child never becomes a zombie. However, it also means the main program can't know what the child process' exit status was. Could you provide more information about why you feel puppet's implementation is incorrect?

Josh Cooper (Jira)

unread,
Jun 11, 2020, 12:24:04 AM6/11/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-4433

Issue https://bugs.launchpad.net/fuel/+bug/1444989 was closed, going to close this ticket.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages