[arvados] updated: 2.5.0-227-g184d9fee6

git repository hosting git at public.arvados.org
Mon Mar 6 14:46:23 UTC 2023


Summary of changes:
 doc/admin/upgrading.html.textile.liquid | 12 ++++++++++-
 lib/controller/handler.go               |  9 ++-------
 lib/controller/handler_test.go          | 35 +++++++++------------------------
 3 files changed, 22 insertions(+), 34 deletions(-)

       via  184d9fee6b72520be286b375ac569702246e224e (commit)
      from  b5874d1fae46eef00662d74fe25e6841bec68650 (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 184d9fee6b72520be286b375ac569702246e224e
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Mar 6 09:45:50 2023 -0500

    20200: Cleanups, mention changes in upgrade notes
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/doc/admin/upgrading.html.textile.liquid b/doc/admin/upgrading.html.textile.liquid
index 13c91803b..e48a27077 100644
--- a/doc/admin/upgrading.html.textile.liquid
+++ b/doc/admin/upgrading.html.textile.liquid
@@ -28,10 +28,20 @@ TODO: extract this information based on git commit messages and generate changel
 <div class="releasenotes">
 </notextile>
 
-h2(#main). development main (as of 2023-01-27)
+h2(#main). development main (as of 2023-03-06)
 
 "previous: Upgrading to 2.5.0":#v2_5_0
 
+h3. Default request concurrency, new limit on log requests
+
+The configuration value @API.MaxConcurrentRequests@ (the number of concurrent requests that will be accepted by a single instance of arvados-controller) now has a default value of 64, instead of being unlimited.
+
+New configuration value @API.LogCreateRequestFraction@ (default 0.50) limits requests that post live container logs to the API server, to avoid situations where log messages crowd out other more important requests.
+
+h3. New limit on concurrent workflows
+
+New configuration options @CloudVMs.SupervisorFraction@ (default 0.30) limits the number of concurrent workflow supervisors, to avoid situations where too many workflow runners crowds out actual workers.
+
 h3. Default limit for cloud VM instances
 
 There is a new configuration entry @CloudVMs.MaxInstances@ (default 64) that limits the number of VMs the cloud dispatcher will run at a time. This may need to be adjusted to suit your anticipated workload.
diff --git a/lib/controller/handler.go b/lib/controller/handler.go
index 0e163d104..9830421eb 100644
--- a/lib/controller/handler.go
+++ b/lib/controller/handler.go
@@ -153,11 +153,6 @@ func (h *Handler) setup() {
 	if logCreateLimit == 0 && h.Cluster.API.LogCreateRequestFraction > 0 {
 		logCreateLimit = 1
 	}
-	if logCreateLimit == 0 {
-		// can't have unlimited size channels, so just make
-		// the buffer size really big.
-		logCreateLimit = 4096
-	}
 	h.limitLogCreate = make(chan struct{}, logCreateLimit)
 
 	h.proxy = &proxy{
@@ -196,11 +191,11 @@ func (h *Handler) localClusterRequest(req *http.Request) (*http.Response, error)
 }
 
 func (h *Handler) limitLogCreateRequests(w http.ResponseWriter, req *http.Request, next http.Handler) {
-	if req.Method == http.MethodPost && strings.HasPrefix(req.URL.Path, "/arvados/v1/logs") {
+	if cap(h.limitLogCreate) > 0 && req.Method == http.MethodPost && strings.HasPrefix(req.URL.Path, "/arvados/v1/logs") {
 		select {
 		case h.limitLogCreate <- struct{}{}:
+			defer <-h.limitLogCreate
 			next.ServeHTTP(w, req)
-			<-h.limitLogCreate
 		default:
 			http.Error(w, "Excess log messages", http.StatusServiceUnavailable)
 		}
diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go
index fe31c1d10..ca58c4c9a 100644
--- a/lib/controller/handler_test.go
+++ b/lib/controller/handler_test.go
@@ -568,16 +568,17 @@ func (s *HandlerSuite) TestLogLimiting(c *check.C) {
 	s.handler.Cluster.API.MaxConcurrentRequests = 2
 	s.handler.Cluster.API.LogCreateRequestFraction = 0.5
 
-	// Log create succeeds
-	for i := 0; i < 2; i++ {
-		req := httptest.NewRequest("POST", "/arvados/v1/logs", strings.NewReader(`{
+	logreq := httptest.NewRequest("POST", "/arvados/v1/logs", strings.NewReader(`{
 			"log": {
                           "event_type": "test"
 			}
 		}`))
-		req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
+	logreq.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
+
+	// Log create succeeds
+	for i := 0; i < 2; i++ {
 		resp := httptest.NewRecorder()
-		s.handler.ServeHTTP(resp, req)
+		s.handler.ServeHTTP(resp, logreq)
 		c.Check(resp.Code, check.Equals, http.StatusOK)
 		var lg arvados.Log
 		err := json.Unmarshal(resp.Body.Bytes(), &lg)
@@ -589,14 +590,8 @@ func (s *HandlerSuite) TestLogLimiting(c *check.C) {
 	s.handler.limitLogCreate <- struct{}{}
 
 	// Log create should be rejected now
-	req := httptest.NewRequest("POST", "/arvados/v1/logs", strings.NewReader(`{
-			"log": {
-                          "event_type": "test"
-			}
-		}`))
-	req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
 	resp := httptest.NewRecorder()
-	s.handler.ServeHTTP(resp, req)
+	s.handler.ServeHTTP(resp, logreq)
 	c.Check(resp.Code, check.Equals, http.StatusServiceUnavailable)
 
 	// Other requests still succeed
@@ -611,28 +606,16 @@ func (s *HandlerSuite) TestLogLimiting(c *check.C) {
 	c.Check(u.UUID, check.Equals, arvadostest.ActiveUserUUID)
 
 	// log create still fails
-	req = httptest.NewRequest("POST", "/arvados/v1/logs", strings.NewReader(`{
-			"log": {
-                          "event_type": "test"
-			}
-		}`))
-	req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
 	resp = httptest.NewRecorder()
-	s.handler.ServeHTTP(resp, req)
+	s.handler.ServeHTTP(resp, logreq)
 	c.Check(resp.Code, check.Equals, http.StatusServiceUnavailable)
 
 	// Pretend in-flight log is done
 	<-s.handler.limitLogCreate
 
 	// log create succeeds again
-	req = httptest.NewRequest("POST", "/arvados/v1/logs", strings.NewReader(`{
-			"log": {
-                          "event_type": "test"
-			}
-		}`))
-	req.Header.Set("Authorization", "Bearer "+arvadostest.ActiveToken)
 	resp = httptest.NewRecorder()
-	s.handler.ServeHTTP(resp, req)
+	s.handler.ServeHTTP(resp, logreq)
 	c.Check(resp.Code, check.Equals, http.StatusOK)
 
 }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list