Skip to content

Commit 30a47c2

Browse files
committed
squeue fails if a job id is passed to -j for a job that is not in the
queue (any more). Because we cannot guarantee that the query intervals are smaller than the intervals at which jobs get purged from the queue, failed `squeue` invocations can happen. This change replaces the `-j` option with `--me`, which lists all jobs for a user. This has the potential of listing more jobs than necessary (since a user can have multiple PSI/J instances managing jobs).
1 parent dbb1824 commit 30a47c2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/psij/executors/batch/slurm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,11 @@ def process_cancel_command_output(self, exit_code: int, out: str) -> None:
147147

148148
def get_status_command(self, native_ids: Collection[str]) -> List[str]:
149149
"""See :meth:`~.BatchSchedulerExecutor.get_status_command`."""
150-
ids = ','.join(native_ids)
151150

152151
# we're not really using job arrays, so this is equivalent to the job ID. However, if
153152
# we were to use arrays, this would return one ID for the entire array rather than
154153
# listing each element of the array independently
155-
return [_SQUEUE_COMMAND, '-O', 'JobArrayID,StateCompact,Reason', '-t', 'all', '-j', ids]
154+
return [_SQUEUE_COMMAND, '-O', 'JobArrayID,StateCompact,Reason', '-t', 'all', '--me']
156155

157156
def parse_status_output(self, exit_code: int, out: str) -> Dict[str, JobStatus]:
158157
"""See :meth:`~.BatchSchedulerExecutor.parse_status_output`."""

0 commit comments

Comments
 (0)