Skip to content

Commit 55379fd

Browse files
committed
Bugfix for situation where squeue command lacks optional fields
1 parent d5a352d commit 55379fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cluster/src/org/labkey/cluster/pipeline/SlurmExecutionEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ protected Set<String> updateStatusForAllJobs() throws PipelineJobException
172172
}
173173
else
174174
{
175-
String hostname = tokens.length > hostnameIdx ? StringUtils.trimToNull(tokens[hostnameIdx]) : null;
175+
String hostname = hostnameIdx != -1 && tokens.length > hostnameIdx ? StringUtils.trimToNull(tokens[hostnameIdx]) : null;
176176
if (hostname != null)
177177
{
178178
j.setHostname(hostname);
179179
}
180180

181181
Pair<String, String> status = translateSlurmStatusToTaskStatus(StringUtils.trimToNull(tokens[stateIdx]));
182182

183-
String reason = tokens.length > reasonIdx ? StringUtils.trimToNull(tokens[reasonIdx]) : null;
183+
String reason = reasonIdx != -1 && tokens.length > reasonIdx ? StringUtils.trimToNull(tokens[reasonIdx]) : null;
184184
if (reason != null)
185185
{
186186
if (!"Priority".equals(reason))

0 commit comments

Comments
 (0)