Skip to content

[bugfix] Return Job.jobid as string always #3493

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

Merged
merged 1 commit into from
May 27, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion reframe/core/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def jobid(self):

:type: :class:`str` or :class:`None`
'''
return self._jobid
return str(self._jobid) if self._jobid is not None else None

@property
def exitcode(self):
Expand Down
8 changes: 4 additions & 4 deletions reframe/core/schedulers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def filternodes(self, job, nodes):
def _kill_all(self, job):
'''Send SIGKILL to all the processes of the spawned job.'''
try:
os.killpg(job.jobid, signal.SIGKILL)
os.killpg(job._jobid, signal.SIGKILL)
job._signal = signal.SIGKILL
except (ProcessLookupError, PermissionError):
# The process group may already be dead or assigned to a different
Expand All @@ -109,7 +109,7 @@ def _kill_all(self, job):
def _term_all(self, job):
'''Send SIGTERM to all the processes of the spawned job.'''
try:
os.killpg(job.jobid, signal.SIGTERM)
os.killpg(job._jobid, signal.SIGTERM)
job._signal = signal.SIGTERM
except (ProcessLookupError, PermissionError):
# Job has finished already, close file handles
Expand Down Expand Up @@ -160,11 +160,11 @@ def poll(self, *jobs):
self._poll_job(job)

def _poll_job(self, job):
if job is None or job.jobid is None:
if job is None or job._jobid is None:
return

try:
pid, status = os.waitpid(job.jobid, os.WNOHANG)
pid, status = os.waitpid(job._jobid, os.WNOHANG)
except OSError as e:
if e.errno == errno.ECHILD:
# No unwaited children
Expand Down
Loading