Skip to content

Commit

Permalink
When the submit command fails, log the batch script at DEBUG level to
Browse files Browse the repository at this point in the history
aid in debugging.
  • Loading branch information
hategan committed Jan 27, 2024
1 parent 6217874 commit 5a8ce2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/psij/executors/batch/batch_scheduler_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ def submit(self, job: Job) -> None:
self._set_job_status(job, JobStatus(JobState.QUEUED,
metadata={'native_id': job.native_id}))
except subprocess.CalledProcessError as ex:
if logger.isEnabledFor(logging.DEBUG):
with submit_file_path.open('r') as submit_file:
script = submit_file.read()
logger.debug('Job %s: submit script is: %s' % (job.id, script))

Check warning on line 234 in src/psij/executors/batch/batch_scheduler_executor.py

View check run for this annotation

Codecov / codecov/patch

src/psij/executors/batch/batch_scheduler_executor.py#L231-L234

Added lines #L231 - L234 were not covered by tests

raise SubmitException(ex.output) from None

self._queue_poll_thread.register_job(job)
Expand Down

0 comments on commit 5a8ce2b

Please sign in to comment.