[ARVADOS] created: 1.3.0-2133-ge7d4393c8

Git user git at public.arvados.org
Thu Feb 6 16:03:06 UTC 2020


        at  e7d4393c847d036c2cf4a4d3c865e2c84636b1f2 (commit)


commit e7d4393c847d036c2cf4a4d3c865e2c84636b1f2
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Thu Feb 6 10:45:48 2020 -0500

    16133: Avoid cycle between old and new controllers.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index 0416549ca..4d4141ffd 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -38,7 +38,11 @@ func New(cluster *arvados.Cluster) *Conn {
 		if !remote.Proxy {
 			continue
 		}
-		remotes[id] = rpc.NewConn(id, &url.URL{Scheme: remote.Scheme, Host: remote.Host}, remote.Insecure, saltedTokenProvider(local, id))
+		conn := rpc.NewConn(id, &url.URL{Scheme: remote.Scheme, Host: remote.Host}, remote.Insecure, saltedTokenProvider(local, id))
+		// Older versions of controller rely on the Via header
+		// to detect loops.
+		conn.SendHeader = http.Header{"Via": {"HTTP/1.1 arvados-controller"}}
+		remotes[id] = conn
 	}
 
 	return &Conn{

commit 4a30eb19ec37e84947f49f2d39b1acae3ebf3847
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Thu Feb 6 10:19:04 2020 -0500

    16133: Avoid cycle when searching federation for PDH.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index 1b1ffef24..0416549ca 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -214,6 +214,8 @@ func (conn *Conn) Login(ctx context.Context, options arvados.LoginOptions) (arva
 }
 
 func (conn *Conn) CollectionGet(ctx context.Context, options arvados.GetOptions) (arvados.Collection, error) {
+	downstream := options.ForwardedFor
+	options.ForwardedFor = conn.cluster.ClusterID + "-" + downstream
 	if len(options.UUID) == 27 {
 		// UUID is really a UUID
 		c, err := conn.chooseBackend(options.UUID).CollectionGet(ctx, options)
@@ -225,6 +227,9 @@ func (conn *Conn) CollectionGet(ctx context.Context, options arvados.GetOptions)
 		// UUID is a PDH
 		first := make(chan arvados.Collection, 1)
 		err := conn.tryLocalThenRemotes(ctx, func(ctx context.Context, remoteID string, be backend) error {
+			if remoteID != "" && strings.Contains(downstream, remoteID) {
+				return notFoundError{}
+			}
 			c, err := be.CollectionGet(ctx, options)
 			if err != nil {
 				return err
diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go
index 6e115a15f..aa670c539 100644
--- a/sdk/go/arvados/api.go
+++ b/sdk/go/arvados/api.go
@@ -62,6 +62,7 @@ type GetOptions struct {
 	UUID         string   `json:"uuid"`
 	Select       []string `json:"select"`
 	IncludeTrash bool     `json:"include_trash"`
+	ForwardedFor string   `json:"forwarded_for"`
 }
 
 type UntrashOptions struct {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list