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

Zombie processes on -HUP #167

Closed
jpotter opened this Issue Feb 11, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@jpotter

jpotter commented Feb 11, 2017

Hi,

I'm noticing on hitch 1.4.4 on CentOS 7 that hitch doesn't correctly clean up prior processes went sent a -HUP.

I.e., before:

root     30483  0.0  1.1  57748 11224 ?        Ss   00:16   0:00 /usr/sbin/hitch --pidfile=/run/hitch/hitch.pid --config=/etc/hitch/hitch.conf
hitch    30484  0.0  1.1  57748 11476 ?        S    00:16   0:00 /usr/sbin/hitch --pidfile=/run/hitch/hitch.pid --config=/etc/hitch/hitch.conf
hitch    30485  0.0  1.1  57748 11480 ?        S    00:16   0:00 /usr/sbin/hitch --pidfile=/run/hitch/hitch.pid --config=/etc/hitch/hitch.conf

Then after kill -HUP 30483, we have a defunct process:

root     30483  0.6  2.1  67116 21724 ?        Ss   00:16   0:00 /usr/sbin/hitch --pidfile=/run/hitch/hitch.pid --config=/etc/hitch/hitch.conf
hitch    30485  0.0  0.0      0     0 ?        Z    00:16   0:00 [hitch] <defunct>
hitch    30488  0.0  2.0  67116 20804 ?        S    00:16   0:00 /usr/sbin/hitch --pidfile=/run/hitch/hitch.pid --config=/etc/hitch/hitch.conf
hitch    30489  0.0  2.0  67116 20952 ?        S    00:16   0:00 /usr/sbin/hitch --pidfile=/run/hitch/hitch.pid --config=/etc/hitch/hitch.conf

This ends up stacking up over time, i.e. each reload of hitch causes another zombie process to stay around:

# ps auxw | grep Z
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
hitch    13630  0.0  0.0      0     0 ?        Z    Feb10   0:00 [hitch] <defunct>
hitch    15272  0.0  0.0      0     0 ?        Z    Feb10   0:00 [hitch] <defunct>
hitch    15444  0.0  0.0      0     0 ?        Z    Feb10   0:00 [hitch] <defunct>
hitch    15495  0.0  0.0      0     0 ?        Z    Feb10   0:00 [hitch] <defunct>
hitch    29346  0.0  0.0      0     0 ?        Z    00:06   0:00 [hitch] <defunct>
hitch    29597  0.0  0.0      0     0 ?        Z    00:07   0:00 [hitch] <defunct>
@dward

This comment has been minimized.

Show comment
Hide comment
@dward

dward Feb 23, 2017

Contributor

I noticed the same thing. On reconfigure, hitch kills the ocsp worker, and then starts a new one. By the time do_wait() is called, ocsp_proc_pid has the new worker pid, instead of the one that should be cleaned up.

I'm currently testing the removal of start_ocsp_proc(); from reconfigure and letting do_wait() do it's job once it receives a SIGCHLD for the kill.

Contributor

dward commented Feb 23, 2017

I noticed the same thing. On reconfigure, hitch kills the ocsp worker, and then starts a new one. By the time do_wait() is called, ocsp_proc_pid has the new worker pid, instead of the one that should be cleaned up.

I'm currently testing the removal of start_ocsp_proc(); from reconfigure and letting do_wait() do it's job once it receives a SIGCHLD for the kill.

@bago

This comment has been minimized.

Show comment
Hide comment
@bago

bago Mar 27, 2017

I'm on Centos7 and I use kill -HUP for hot reloading of certificates (well, in fact I switched from pound to hitch mainly for this great feature).

I can confirm that since upgrading to hitch-1.4.4-2.el7.x86_64 I started seeing defunct processes. Previously I was on hitch-1.4.1-1.el7.x86_64 and never had defuct processes.

bago commented Mar 27, 2017

I'm on Centos7 and I use kill -HUP for hot reloading of certificates (well, in fact I switched from pound to hitch mainly for this great feature).

I can confirm that since upgrading to hitch-1.4.4-2.el7.x86_64 I started seeing defunct processes. Previously I was on hitch-1.4.1-1.el7.x86_64 and never had defuct processes.

@daghf daghf self-assigned this Apr 5, 2017

@daghf daghf closed this in a25095f Apr 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment