[arvados] updated: 2.6.0-263-gb6103b727

git repository hosting git at public.arvados.org
Mon Jun 12 19:48:39 UTC 2023


Summary of changes:
 lib/dispatchcloud/scheduler/scheduler.go | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

       via  b6103b727f2ffeae0d9a4702c158842df71a2128 (commit)
      from  61b45d1413d21a4f6a0fd6449680f0d03eac1d88 (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 b6103b727f2ffeae0d9a4702c158842df71a2128
Author: Tom Clegg <tom at curii.com>
Date:   Mon Jun 12 15:47:57 2023 -0400

    20601: Slow down container queue polling when busy/slow.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/dispatchcloud/scheduler/scheduler.go b/lib/dispatchcloud/scheduler/scheduler.go
index 21510ee09..892f2f3ca 100644
--- a/lib/dispatchcloud/scheduler/scheduler.go
+++ b/lib/dispatchcloud/scheduler/scheduler.go
@@ -172,14 +172,23 @@ func (sch *Scheduler) run() {
 	}
 
 	// Keep the queue up to date.
-	poll := time.NewTicker(sch.queueUpdateInterval)
-	defer poll.Stop()
 	go func() {
-		for range poll.C {
+		for {
+			starttime := time.Now()
 			err := sch.queue.Update()
 			if err != nil {
 				sch.logger.Errorf("error updating queue: %s", err)
 			}
+			// If the previous update took a long time,
+			// that probably means the server is
+			// overloaded, so wait that long before doing
+			// another. Otherwise, wait for the configured
+			// poll interval.
+			delay := time.Since(starttime)
+			if delay < sch.queueUpdateInterval {
+				delay = sch.queueUpdateInterval
+			}
+			time.Sleep(delay)
 		}
 	}()
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list