Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logfile quoting and scancel error handling #140

Merged
merged 6 commits into from
Sep 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def run_job(self, job: JobExecutorInterface):
f"sbatch "
f"--parsable "
f"--job-name {self.run_uuid} "
f"--output {slurm_logfile} "
f"--output '{slurm_logfile}' "
f"--export=ALL "
f"--comment {comment_str}"
)
Expand Down Expand Up @@ -408,6 +408,14 @@ def cancel_jobs(self, active_jobs: List[SubmittedJobInfo]):
)
except subprocess.TimeoutExpired:
self.logger.warning("Unable to cancel jobs within a minute.")
except subprocess.CalledProcessError as e:
msg = e.stderr.strip()
if msg:
msg = f": {msg}"
raise WorkflowError(
"Unable to cancel jobs with scancel "
f"(exit code {e.returncode}){msg}"
) from e

async def job_stati(self, command):
"""Obtain SLURM job status of all submitted jobs with sacct
Expand Down
Loading