SIGHUP leaves daemon workers behind

Bug #1704897 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
New
Low
Unassigned

Bug Description

The auditor forks children. Some other daemon may also decide to do that some day [1]. The default behavior for SIGUP seems to be to kill the parent process - but since we only install our daemon signal handler which kills the whole progress group for SIGTERM [2] - sending SIGHUP will leave orphaned processes.

This isn't the end of the world.

1) swift-init already does the right thing for "stop" command [3]
2) auditor workers will run to completion and exit [4]

So it's only a weird gotcha when rolling your own process management (e.g. systemd unit-files) and you accidentally think SIGHUP will be ok for swift's daemons since it has a defined behavior for swift's wsgi-servers. And then you also implement a daemon who's workers will run until they receive SIGTERM.

Fix is probably just to install kill_children for SIGHUP as well.

1. https://review.openstack.org/#/c/478416/
2. https://github.com/openstack/swift/blob/e1a2c28ec3b7499180a9f52a98dc2a2f02a1baf7/swift/common/daemon.py#L48
3. https://github.com/openstack/swift/blob/e1a2c28ec3b7499180a9f52a98dc2a2f02a1baf7/swift/common/manager.py#L605
4. https://github.com/openstack/swift/blob/e1a2c28ec3b7499180a9f52a98dc2a2f02a1baf7/swift/obj/auditor.py#L337

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.