12552: Skip extra lookup.
authorTom Clegg <tclegg@veritasgenetics.com>
Mon, 26 Feb 2018 14:46:39 +0000 (09:46 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 26 Feb 2018 14:46:39 +0000 (09:46 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

services/crunch-dispatch-slurm/squeue.go

index e2699543cdf2733938639a2b6ef9e22fcb471e5b..b8e3108c7c1a235e7c7e28ffc10974652a35cc6a 100644 (file)
@@ -54,15 +54,16 @@ func (sqc *SqueueChecker) SetPriority(uuid string, want int64) {
        sqc.startOnce.Do(sqc.start)
        sqc.L.Lock()
        defer sqc.L.Unlock()
-       if _, ok := sqc.queue[uuid]; !ok {
+       job, ok := sqc.queue[uuid]
+       if !ok {
                // Wait in case the slurm job was just submitted and
                // will appear in the next squeue update.
                sqc.Wait()
-               if _, ok = sqc.queue[uuid]; !ok {
+               if job, ok = sqc.queue[uuid]; !ok {
                        return
                }
        }
-       sqc.queue[uuid].wantPriority = want
+       job.wantPriority = want
 }
 
 // adjust slurm job nice values as needed to ensure slurm priority