diff --git a/CHANGES b/CHANGES index 25212ac1..24f449d1 100644 --- a/CHANGES +++ b/CHANGES @@ -150,6 +150,10 @@ M movers/mover.py (12) Code cleanup - Removed deprecated functions: getTURLFileInfoDic(), updatePFN(), getDefaultStorage() (Mover) +Process kills +- Switched to using killpg() instead of kill -9 in killOrphans(), as suggested by P. McGuigan while + debugging left processes after looping job kill (processes) + Updates from W. Guan: https://github.com/PanDAWMS/pilot/pull/221 diff --git a/processes.py b/processes.py index f3f7c7d8..fa3f4e71 100644 --- a/processes.py +++ b/processes.py @@ -208,12 +208,14 @@ def killOrphans(): if args.endswith('bash'): pUtil.tolog("Will not kill bash process") else: - cmd = 'kill -9 %s' % (pid) - ec, rs = commands.getstatusoutput(cmd) - if ec != 0: - pUtil.tolog("!!WARNING!!2999!! %s" % (rs)) - else: - pUtil.tolog("Killed orphaned process %s (%s)" % (pid, args)) + os.killpg(pid, signal.SIGKILL) + #cmd = 'kill -9 %s' % (pid) + #ec, rs = commands.getstatusoutput(cmd) + #if ec != 0: + # pUtil.tolog("!!WARNING!!2999!! %s" % (rs)) + #else: + # pUtil.tolog("Killed orphaned process %s (%s)" % (pid, args)) + pUtil.tolog("Killed orphaned process group %s (%s)" % (pid, args)) if count == 0: pUtil.tolog("Did not find any orphan processes")