[ARVADOS] created: 1.3.0-2132-g107eb2786

Git user git at public.arvados.org
Thu Feb 6 15:19:34 UTC 2020


        at  107eb2786d609d7d01f73283e5ecaf6ba9ddfbf5 (commit)


commit 107eb2786d609d7d01f73283e5ecaf6ba9ddfbf5
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..92492467c 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -214,6 +214,7 @@ func (conn *Conn) Login(ctx context.Context, options arvados.LoginOptions) (arva
 }
 
 func (conn *Conn) CollectionGet(ctx context.Context, options arvados.GetOptions) (arvados.Collection, error) {
+	options.ForwardedFor = conn.cluster.ClusterID + "," + options.ForwardedFor
 	if len(options.UUID) == 27 {
 		// UUID is really a UUID
 		c, err := conn.chooseBackend(options.UUID).CollectionGet(ctx, options)
@@ -225,6 +226,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 strings.Contains(options.ForwardedFor, 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