Skip to content

Commit 7a440f3

Browse files
authored
Add debug logging around local channel process launch (#3493)
This is driven by a case where it is unclear when the Parsl scaling code is launching processes to monitor batch queue status. This will add 4 debug lines per block started, block cancelled, and per poll (limited by provider.status_polling_interval() and config.strategy_period)
1 parent 5e03e1f commit 7a440f3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

parsl/channels/local/local.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def execute_wait(self, cmd, walltime=None, envs={}):
5555
current_env.update(envs)
5656

5757
try:
58+
logger.debug("Creating process with command '%s'", cmd)
5859
proc = subprocess.Popen(
5960
cmd,
6061
stdout=subprocess.PIPE,
@@ -64,12 +65,16 @@ def execute_wait(self, cmd, walltime=None, envs={}):
6465
shell=True,
6566
preexec_fn=os.setpgrp
6667
)
68+
logger.debug("Created process with pid %s. Performing communicate", proc.pid)
6769
(stdout, stderr) = proc.communicate(timeout=walltime)
6870
retcode = proc.returncode
71+
logger.debug("Process %s returned %s", proc.pid, proc.returncode)
6972

70-
except Exception as e:
71-
logger.warning("Execution of command '{}' failed due to \n{}".format(cmd, e))
73+
except Exception:
74+
logger.exception(f"Execution of command failed:\n{cmd}")
7275
raise
76+
else:
77+
logger.debug("Execution of command in process %s completed normally", proc.pid)
7378

7479
return (retcode, stdout.decode("utf-8"), stderr.decode("utf-8"))
7580

0 commit comments

Comments
 (0)