Skip to content

Commit 58ff5ec

Browse files
authored
Merge pull request #440 from ExaWorks/log_submit_script_on_submit_error
When the submit command fails, log the batch script at DEBUG level to
2 parents d3ab9cf + 5a8ce2b commit 58ff5ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/psij/executors/batch/batch_scheduler_executor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ def submit(self, job: Job) -> None:
228228
self._set_job_status(job, JobStatus(JobState.QUEUED,
229229
metadata={'native_id': job.native_id}))
230230
except subprocess.CalledProcessError as ex:
231+
if logger.isEnabledFor(logging.DEBUG):
232+
with submit_file_path.open('r') as submit_file:
233+
script = submit_file.read()
234+
logger.debug('Job %s: submit script is: %s' % (job.id, script))
235+
231236
raise SubmitException(ex.output) from None
232237

233238
self._queue_poll_thread.register_job(job)

0 commit comments

Comments
 (0)