Skip to content

Commit 6dad273

Browse files
authored
fix: issue #109 - preemption is no longer considered a failed status (#132)
1 parent ce56cf6 commit 6dad273

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.coderabbit.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
profile: "chill"
6+
request_changes_workflow: false
7+
high_level_summary: true
8+
poem: true
9+
review_status: true
10+
collapse_walkthrough: false
11+
auto_review:
12+
enabled: true
13+
drafts: false
14+
chat:
15+
auto_reply: true

snakemake_executor_plugin_slurm/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def __post_init__(self):
7676
self.logger.info(f"SLURM run ID: {self.run_uuid}")
7777
self._fallback_account_arg = None
7878
self._fallback_partition = None
79+
self._preemption_warning = False # no preemption warning has been issued
7980
# providing a short-hand, even if subsequent calls seem redundant
8081
self.settings: ExecutorSettings = self.workflow.executor_settings
8182

@@ -248,7 +249,6 @@ async def check_active_jobs(
248249
"FAILED",
249250
"NODE_FAIL",
250251
"OUT_OF_MEMORY",
251-
"PREEMPTED",
252252
"TIMEOUT",
253253
"ERROR",
254254
)
@@ -348,6 +348,16 @@ async def check_active_jobs(
348348
self.report_job_success(j)
349349
any_finished = True
350350
active_jobs_seen_by_sacct.remove(j.external_jobid)
351+
elif status == "PREEMPTED" and not self._preemption_warning:
352+
self._preemption_warning = True
353+
self.logger.warning(
354+
"""
355+
===== A Job preemption occured! =====
356+
Leave Snakemake running, if possible. Otherwise Snakemake
357+
needs to restart this job upon a Snakemake restart.
358+
359+
We leave it to SLURM to resume your job(s)"""
360+
)
351361
elif status == "UNKNOWN":
352362
# the job probably does not exist anymore, but 'sacct' did not work
353363
# so we assume it is finished

0 commit comments

Comments
 (0)