diff --git a/PILOTVERSION b/PILOTVERSION index 2fb403f4..c0387ef0 100644 --- a/PILOTVERSION +++ b/PILOTVERSION @@ -1 +1 @@ -3.9.2.23b \ No newline at end of file +3.9.2.23 \ No newline at end of file diff --git a/pilot/util/constants.py b/pilot/util/constants.py index 1334b93b..2f0ae675 100644 --- a/pilot/util/constants.py +++ b/pilot/util/constants.py @@ -28,7 +28,7 @@ RELEASE = '3' # released number should be fixed at 3 for Pilot 3 VERSION = '9' # version number is '1' for first release, '0' until then, increased for bigger updates REVISION = '2' # revision number should be reset to '0' for every new version release, increased for small updates -BUILD = '23' # build number should be reset to '1' for every new development cycle +BUILD = '24' # build number should be reset to '1' for every new development cycle SUCCESS = 0 FAILURE = 1 diff --git a/pilot/util/psutils.py b/pilot/util/psutils.py index ba18e1b1..dbd4fbbd 100644 --- a/pilot/util/psutils.py +++ b/pilot/util/psutils.py @@ -321,3 +321,23 @@ def find_actual_payload_pid(bash_pid: int, payload_cmd: str) -> int or None: logger.warning(f'could not find payload PID for bash PID {bash_pid}') return None + + +def find_lingering_processes(parent_pid: int) -> list: + """ + Find processes that are still running after the specified parent process has terminated. + + :param parent_pid: The PID of the parent process (int) + :return: A list of lingering process PIDs (list). + """ + if not _is_psutil_available: + logger.warning('psutil not available, cannot find lingering processes - aborting') + return [] + + lingering_processes = [] + parent_process = psutil.Process(parent_pid) + for child in parent_process.children(recursive=True): + if child.status() != psutil.STATUS_ZOMBIE: + lingering_processes.append(child.pid) + + return lingering_processes