[ARVADOS] updated: 1.2.0-94-ge780e337d

Git user git at public.curoverse.com
Wed Sep 5 14:49:28 EDT 2018


Summary of changes:
 services/crunch-dispatch-slurm/crunch-dispatch-slurm.go |  2 +-
 services/crunch-dispatch-slurm/slurm.go                 | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

       via  e780e337d170036a69879debeb347a9c26a81518 (commit)
       via  499208bc547b8151fcf3a4230fab28720f94b13c (commit)
      from  ec2d38f6129879183ce4e940e44afa7d3e6dca27 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e780e337d170036a69879debeb347a9c26a81518
Merge: ec2d38f61 499208bc5
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Sep 5 14:47:19 2018 -0400

    Merge branch 'wtsi/14110-c-d-s-limit-slurm-concurrency' refs #14110
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --cc services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index ce0360261,16d9fd18d..084700d39
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@@ -176,9 -159,8 +176,9 @@@ func (disp *Dispatcher) setup() 
  	}
  	arv.Retries = 25
  
- 	disp.slurm = &slurmCLI{}
+ 	disp.slurm = NewSlurmCLI()
  	disp.sqCheck = &SqueueChecker{
 +		Logger:         disp.logger,
  		Period:         time.Duration(disp.PollPeriod),
  		PrioritySpread: disp.PrioritySpread,
  		Slurm:          disp.slurm,

commit 499208bc547b8151fcf3a4230fab28720f94b13c
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Thu Aug 23 19:49:44 2018 +0000

    limit concurrent slurm commands
    
    use a semaphore channel to limit concurrent sbatch/scancel/scontrol commands to 3.
    squeue is already limited to one at a time.
    
    fixes 14110
    
    Arvados-DCO-1.1-Signed-off-by: Joshua C. Randall <jcrandall at alum.mit.edu>

diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index 36ef26496..16d9fd18d 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -159,7 +159,7 @@ func (disp *Dispatcher) setup() {
 	}
 	arv.Retries = 25
 
-	disp.slurm = &slurmCLI{}
+	disp.slurm = NewSlurmCLI()
 	disp.sqCheck = &SqueueChecker{
 		Period:         time.Duration(disp.PollPeriod),
 		PrioritySpread: disp.PrioritySpread,
diff --git a/services/crunch-dispatch-slurm/slurm.go b/services/crunch-dispatch-slurm/slurm.go
index 9e9f45270..782be7d8c 100644
--- a/services/crunch-dispatch-slurm/slurm.go
+++ b/services/crunch-dispatch-slurm/slurm.go
@@ -20,7 +20,15 @@ type Slurm interface {
 	Renice(name string, nice int64) error
 }
 
-type slurmCLI struct{}
+type slurmCLI struct{
+	runSemaphore chan bool
+}
+
+func NewSlurmCLI() *slurmCLI {
+	return &slurmCLI{
+	       runSemaphore: make(chan bool, 3),
+	}
+}
 
 func (scli *slurmCLI) Batch(script io.Reader, args []string) error {
 	return scli.run(script, "sbatch", args)
@@ -64,6 +72,8 @@ func (scli *slurmCLI) Renice(name string, nice int64) error {
 }
 
 func (scli *slurmCLI) run(stdin io.Reader, prog string, args []string) error {
+	scli.runSemaphore <- true
+	defer func() { <-scli.runSemaphore }()
 	cmd := exec.Command(prog, args...)
 	cmd.Stdin = stdin
 	out, err := cmd.CombinedOutput()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list