Skip to content

Commit 01d7efc

Browse files
author
Vasileios Karakasis
authored
Merge pull request #1662 from teojgo/bugfix/joberror_jobid
[bugfix] Pass the job id when raising job-related errors
2 parents 8134945 + ffcc5cc commit 01d7efc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

reframe/core/schedulers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import reframe.utility.typecheck as typ
1818
from reframe.core.exceptions import JobError, JobNotStartedError
1919
from reframe.core.launchers import JobLauncher
20-
from reframe.core.logging import (getlogger, DEBUG2)
20+
from reframe.core.logging import getlogger, DEBUG2
2121

2222

2323
class JobScheduler(abc.ABC):

reframe/core/schedulers/pbs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
import reframe.core.schedulers as sched
2020
import reframe.utility.osext as osext
2121
from reframe.core.backends import register_scheduler
22-
from reframe.core.config import settings
23-
from reframe.core.exceptions import (JobError, JobSchedulerError)
22+
from reframe.core.exceptions import JobError, JobSchedulerError
2423
from reframe.utility import seconds_to_hms
2524

2625

@@ -263,7 +262,8 @@ def poll(self, *jobs):
263262
job.max_pending_time):
264263
if (time.time() - job.submit_time >= job.max_pending_time):
265264
self.cancel(job)
266-
job._exception = JobError('maximum pending time exceeded')
265+
job._exception = JobError('maximum pending time exceeded',
266+
job.jobid)
267267

268268

269269
@register_scheduler('torque')

reframe/core/schedulers/slurm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from argparse import ArgumentParser
1212
from contextlib import suppress
1313

14-
import reframe.core.environments as env
1514
import reframe.core.runtime as rt
1615
import reframe.core.schedulers as sched
1716
import reframe.utility.osext as osext
@@ -432,7 +431,8 @@ def _cancel_if_pending_too_long(self, job):
432431
if t_pending >= job.max_pending_time:
433432
self.log(f'maximum pending time for job exceeded; cancelling it')
434433
self.cancel(job)
435-
job._exception = JobError('maximum pending time exceeded')
434+
job._exception = JobError('maximum pending time exceeded',
435+
job.jobid)
436436

437437
def _cancel_if_blocked(self, job, reasons=None):
438438
if (job.is_cancelling or not slurm_state_pending(job.state)):
@@ -490,7 +490,7 @@ def _do_cancel_if_blocked(self, job, reason_descr):
490490
if reason_details is not None:
491491
reason_msg += ', ' + reason_details
492492

493-
job._exception = JobBlockedError(reason_msg)
493+
job._exception = JobBlockedError(reason_msg, job.jobid)
494494

495495
def wait(self, job):
496496
# Quickly return in case we have finished already

0 commit comments

Comments
 (0)