swift-object-auditor keeps forking processes if /srv is not accessible
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
We have discovered that the swift-object- auditor will just keep forking off new processes in the case that the /srv directory has the wrong permissions set. The result is that it acts like a fork bomb which is not desirable.
Sep 29 11:22:30 oc0644314035 object-auditor: Begin object audit "forever" mode (ZBF)
Sep 29 11:22:30 oc0644314035 object-auditor: Begin object audit "forever" mode (ALL)
Sep 29 11:22:30 oc0644314035 object-auditor: ERROR auditing: [Errno 13] Permission denied: '/srv/node': #012Traceback (most recent call last):#012 File "/usr/lib/
Sep 29 11:22:30 oc0644314035 object-auditor: ERROR auditing: [Errno 13] Permission denied: '/srv/node': #012Traceback (most recent call last):#012 File "/usr/lib/
-------
-bash-4.1# ps aux | grep swift | grep auditor
swift 23462 0.7 0.7 228040 14216 ? Ss 17:06 0:00 /usr/bin/python /usr/bin/
swift 23524 0.9 0.7 228024 14228 ? Ss 17:07 0:00 /usr/bin/python /usr/bin/
swift 23586 1.1 0.8 237788 16260 ? Ss 17:07 0:00 /usr/bin/python /usr/bin/
swift 23598 0.0 0.7 238144 14096 ? S 17:07 0:00 /usr/bin/python /usr/bin/
swift 23599 0.0 0.7 238144 14096 ? S 17:07 0:00 /usr/bin/python /usr/bin/
-bash-4.1# ps aux | grep swift | grep auditor | wc -l
5
-bash-4.1# ps aux | grep swift | grep auditor | wc -l
9
-bash-4.1# ps aux | grep swift | grep auditor | wc -l
9
-bash-4.1# ps aux | grep swift | grep auditor
swift 23462 0.4 0.7 228040 14216 ? Ss 17:06 0:00 /usr/bin/python /usr/bin/
swift 23524 0.5 0.7 228024 14228 ? Ss 17:07 0:00 /usr/bin/python /usr/bin/
swift 23586 0.5 0.8 237788 16260 ? Ss 17:07 0:00 /usr/bin/python /usr/bin/
swift 23598 0.0 0.7 238144 14276 ? S 17:07 0:00 /usr/bin/python /usr/bin/
swift 23599 0.0 0.7 238144 14244 ? S 17:07 0:00 /usr/bin/python /usr/bin/
swift 23676 0.0 0.7 238144 14044 ? S 17:07 0:00 /usr/bin/python /usr/bin/
swift 23677 0.0 0.7 238144 14044 ? S 17:07 0:00 /usr/bin/python /usr/bin/
swift 23678 0.0 0.7 238144 14052 ? S 17:07 0:00 /usr/bin/python /usr/bin/
swift 23679 0.0 0.7 238144 14052 ? S 17:07 0:00 /usr/bin/python /usr/bin/
-bash-4.1# ps aux | grep swift | grep auditor | wc -l
9
-bash-4.1# ps aux | grep swift | grep auditor | wc -l
9
-bash-4.1# ps aux | grep swift | grep auditor | wc -l
17
-bash-4.1#
I am working on narrowing down the source of the problem.
Changed in swift: | |
milestone: | none → 2.2.0-rc1 |
status: | Fix Committed → Fix Released |
Changed in swift: | |
milestone: | 2.2.0-rc1 → 2.2.0 |
def fork_child(self, zero_byte_ fps=False, **kwargs):
signal. signal( signal. SIGTERM, signal.SIG_DFL)
kwargs[ 'zero_byte_ fps'] = self.conf_ zero_byte_ fps
self.run_ audit(* *kwargs)
"""Child execution"""
pid = os.fork()
if pid:
return pid
else:
if zero_byte_fps:
sys.exit()
I think the problem is here. If self.run_ audit(* *kwargs) returns an exception we never call sys.exit() so, eventually we end up with a bunch of zombie processes. I am working on finding a way of handling this that allows me to log the issue. Having a problem there at the moment.