| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
aix getpgid fails when called from parent and parent and child have different session
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
method, aix removed method was slow.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
[#MIXLIB-19] Copy stderr to live_stream along with stdout of the subprocess
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Originally we needed this hack for 1.8.6 and 1.8.7, which were the most
common versions in use at the time. 1.8.6 is dead so we don't need to
account for it any more, which leaves 1.8.7 as the only case we need to
care about for this hack. On Ruby 1.9 and greater this hack isn't needed
and causes memory bloat for very long running shell commands.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There is not a good way to reliably detect whether all grandchildren
have exited after sending a TERM to the process group; if the child has
correctly exited, grandchildren (which may be unresponsive) will have
been adopted by init (ppid == 1) so the parent cannot wait() on them. To
ensure no stuck grandchildren are left, send a KILL to the process group
after allowing the processes time to clean up.
|
| |
| |
| |
| |
| |
| |
| | |
To ensure that all child processes are properly signaled to exit before
forcibly killing them, use `setsid()` in the child process to give the
child (and any grandchildren it might create) a new and unique process
group. If the command times out, kill and reap the entire process group.
|
| |
| |
| |
| |
| | |
If no logger is configured, we still want to inform the user that the
process was killed (and how).
|
| |
| |
| |
| |
| | |
If a logger is configured, send `error` level messages about child
process termination for timeout violations.
|
| |
| |
| |
| |
| | |
removes some complexity that was introduced with the fix to kill
timed-out child processes
|
|/
|
|
|
|
|
|
| |
Fixes MIXLIB-16.
This issue is particularly prominent when yum/rpm commands go off the
deep end repeatedly, but affects any case where a process takes longer
than the timeout to complete.
|
|
|
|
|
|
|
|
| |
This is a compromise that prevents us from leaving zombie processes
around after a failed exec raises ENOENT, but prevents us from blocking
(possibly forever) on timed-out commands. The latter case can cause
zombies, so this is not optimal for all cases. See MIXLIB-16 for a
proposed enhancement to solve that case.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ported the regression test from OHAI-455 to mixlib-shellout, which
revealed a race condition in the way shellout reaps the child after a
failed exec (most commonly caused by attempting to run a command that
doesn't exist). The call to waitpid2 used WNOHANG to avoid hanging
indefinitely if an error was caused but the child process was still
alive, but this results in the child process not getting reaped if it
exits after the call to waitpid2. In a single run of the stress test,
this occurred 94/100 times, so it is very likely that mixlib-shellout
will leak zombies for the ENOENT case without this change.
|
|
|
|
|
|
| |
- Unsure how File.for_fd() succeeds and then then #close on the File
throws this, but it must be racing with something. I don't think
we care.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Ruby < 1.8.7p369 has a bug related to Marshall.load and GC, so let's disable
Garbage Collection a little earlier.
http://bugs.ruby-lang.org/issues/4339
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Properly remove child's stderr pipe from the list of IO objects to
select on in the case that stdout has already been removed from the
list. This prevents a situation where the stdout stream is always
considered readable by select (because it has reached eof) but ShellOut
would attempt to read from it in a tight loop. Since GC is disabled
while a command is running, this would generate a bunch of EOFError
objects that were not reaped and use a ton of heap space.
|
| |
|
|
|