13399: Adjust locking strategy to avoid starvation.
authorTom Clegg <tclegg@veritasgenetics.com>
Mon, 6 Aug 2018 16:59:30 +0000 (12:59 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 6 Aug 2018 16:59:30 +0000 (12:59 -0400)
commit0fe48142de81e20967eaac3972e35d115aaaa497
tree4570212d824d1dd3054bc289c26716288df9dadf
parentdf29ab509d3a9f6275fade0b7b8c9b5cd8d6f74d
13399: Adjust locking strategy to avoid starvation.

Don't acquire the slurm lock to call scancel or sbatch.

Don't acquire the slurm lock again immediately after updating the
queue and broadcasting. Instead, give readers a chance to reacquire
the lock after Wait().

Acquire a shared lock instead of an exclusive lock in HasUUID() or
SetPriority() when the protected operation is a read.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>
services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
services/crunch-dispatch-slurm/squeue.go