Skip to content

Commit 3ca0620

Browse files
committed
Bugfix for slurm parsing with PENDING jobs
1 parent 943b89d commit 3ca0620

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected Set<String> updateStatusForAllJobs() throws PipelineJobException
158158
}
159159
else
160160
{
161-
String hostname = StringUtils.trimToNull(tokens[hostnameIdx]);
161+
String hostname = tokens.length > hostnameIdx ? StringUtils.trimToNull(tokens[hostnameIdx]) : null;
162162
if (hostname != null)
163163
{
164164
j.setHostname(hostname);
@@ -256,7 +256,7 @@ else if (headerFound)
256256

257257
if (hostnameIdx > -1)
258258
{
259-
String hostname = StringUtils.trimToNull(tokens[hostnameIdx]);
259+
String hostname = tokens.length > hostnameIdx ? StringUtils.trimToNull(tokens[hostnameIdx]) : null;
260260
if (hostname != null)
261261
{
262262
if (job.getHostname() == null || !job.getHostname().equals(hostname))
@@ -632,7 +632,7 @@ private Pair<String, String> getStatusFromQueue(ClusterJob job)
632632
{
633633
if (hostnameIdx > -1)
634634
{
635-
String hostname = StringUtils.trimToNull(tokens[hostnameIdx]);
635+
String hostname = tokens.length > hostnameIdx ? StringUtils.trimToNull(tokens[hostnameIdx]) : null;
636636
if (hostname != null)
637637
{
638638
job.setHostname(hostname);

0 commit comments

Comments
 (0)