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,
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{
}
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"]`},
})
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)
import (
"context"
"fmt"
+ "time"
"git.arvados.org/arvados.git/lib/cmd"
"git.arvados.org/arvados.git/lib/service"
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,