[arvados] updated: 2.5.0-201-g8bf73cc97
git repository hosting
git at public.arvados.org
Tue Feb 28 21:04:16 UTC 2023
Summary of changes:
lib/dispatchcloud/cmd.go | 4 ++++
lib/dispatchcloud/dispatcher_test.go | 3 ++-
services/ws/permission.go | 4 +++-
services/ws/permission_test.go | 4 +++-
services/ws/service.go | 2 ++
5 files changed, 14 insertions(+), 3 deletions(-)
via 8bf73cc97939080f30a893131eaf4cb7232bdd47 (commit)
from 9baa7be4c57756cfef3a19139edbc54d398340e0 (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 8bf73cc97939080f30a893131eaf4cb7232bdd47
Author: Tom Clegg <tom at curii.com>
Date: Tue Feb 28 16:04:10 2023 -0500
19972: Disable auto-retry in ws and dispatcher.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/dispatchcloud/cmd.go b/lib/dispatchcloud/cmd.go
index 0254c6526..81982cdc1 100644
--- a/lib/dispatchcloud/cmd.go
+++ b/lib/dispatchcloud/cmd.go
@@ -21,6 +21,10 @@ func newHandler(ctx context.Context, cluster *arvados.Cluster, token string, reg
if err != nil {
return service.ErrorHandler(ctx, cluster, fmt.Errorf("error initializing client from cluster config: %s", err))
}
+ // Disable auto-retry. We have transient failure recovery at
+ // the application level, so we would rather receive/report
+ // upstream errors right away.
+ ac.Timeout = 0
d := &dispatcher{
Cluster: cluster,
Context: ctx,
diff --git a/lib/dispatchcloud/dispatcher_test.go b/lib/dispatchcloud/dispatcher_test.go
index a9ed95c7c..9d7d3736b 100644
--- a/lib/dispatchcloud/dispatcher_test.go
+++ b/lib/dispatchcloud/dispatcher_test.go
@@ -101,7 +101,8 @@ func (s *DispatcherSuite) SetUpTest(c *check.C) {
arvadostest.SetServiceURL(&s.cluster.Services.Controller, "https://"+os.Getenv("ARVADOS_API_HOST")+"/")
arvClient, err := arvados.NewClientFromConfig(s.cluster)
- c.Check(err, check.IsNil)
+ c.Assert(err, check.IsNil)
+ arvClient.Timeout = 0 // disable auto-retry
s.error503Server = httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusServiceUnavailable) }))
arvClient.Client = &http.Client{
diff --git a/services/ws/permission.go b/services/ws/permission.go
index ac895f80e..78158b12a 100644
--- a/services/ws/permission.go
+++ b/services/ws/permission.go
@@ -75,7 +75,9 @@ func (pc *cachingPermChecker) Check(ctx context.Context, uuid string) (bool, err
}
pc.nMisses++
- err = pc.RequestAndDecode(&buf, "GET", path, nil, url.Values{
+ ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute))
+ defer cancel()
+ err = pc.RequestAndDecodeContext(ctx, &buf, "GET", path, nil, url.Values{
"include_trash": {"true"},
"select": {`["uuid"]`},
})
diff --git a/services/ws/permission_test.go b/services/ws/permission_test.go
index 023656c01..2e08cea48 100644
--- a/services/ws/permission_test.go
+++ b/services/ws/permission_test.go
@@ -17,7 +17,9 @@ var _ = check.Suite(&permSuite{})
type permSuite struct{}
func (s *permSuite) TestCheck(c *check.C) {
- pc := newPermChecker(*(arvados.NewClientFromEnv())).(*cachingPermChecker)
+ client := arvados.NewClientFromEnv()
+ client.Timeout = 0 // disable auto-retry
+ pc := newPermChecker(*client).(*cachingPermChecker)
setToken := func(label, token string) {
c.Logf("...%s token %q", label, token)
pc.SetToken(token)
diff --git a/services/ws/service.go b/services/ws/service.go
index 761e22e16..d6501e077 100644
--- a/services/ws/service.go
+++ b/services/ws/service.go
@@ -7,6 +7,7 @@ package ws
import (
"context"
"fmt"
+ "time"
"git.arvados.org/arvados.git/lib/cmd"
"git.arvados.org/arvados.git/lib/service"
@@ -24,6 +25,7 @@ func newHandler(ctx context.Context, cluster *arvados.Cluster, token string, reg
if err != nil {
return service.ErrorHandler(ctx, cluster, fmt.Errorf("error initializing client from cluster config: %s", err))
}
+ client.Timeout = time.Minute
eventSource := &pgEventSource{
DataSource: cluster.PostgreSQL.Connection.String(),
MaxOpenConns: cluster.PostgreSQL.ConnectionPool,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list