Skip to content

Commit e89d322

Browse files
author
Theofilos Manitaras
committed
Pass the jobid when raising a 'JobError'
1 parent 8134945 commit e89d322

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import reframe.utility.osext as osext
2121
from reframe.core.backends import register_scheduler
2222
from reframe.core.config import settings
23-
from reframe.core.exceptions import (JobError, JobSchedulerError)
23+
from reframe.core.exceptions import JobError, JobSchedulerError
2424
from reframe.utility import seconds_to_hms
2525

2626

@@ -263,7 +263,8 @@ def poll(self, *jobs):
263263
job.max_pending_time):
264264
if (time.time() - job.submit_time >= job.max_pending_time):
265265
self.cancel(job)
266-
job._exception = JobError('maximum pending time exceeded')
266+
job._exception = JobError('maximum pending time exceeded',
267+
job.jobid)
267268

268269

269270
@register_scheduler('torque')

reframe/core/schedulers/slurm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def _cancel_if_pending_too_long(self, job):
432432
if t_pending >= job.max_pending_time:
433433
self.log(f'maximum pending time for job exceeded; cancelling it')
434434
self.cancel(job)
435-
job._exception = JobError('maximum pending time exceeded')
435+
job._exception = JobError('maximum pending time exceeded', 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)