From dceebc9953147b08b68a36330e213f7280851450 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 9 Mar 2023 09:27:30 -0500 Subject: [PATCH] 20187: 1 minute timeout for getting discovery doc from rails. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/controller/handler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/controller/handler.go b/lib/controller/handler.go index c3bbfd2d94..ce3243f6cb 100644 --- a/lib/controller/handler.go +++ b/lib/controller/handler.go @@ -239,10 +239,12 @@ func (ent *cacheEnt) refresh(path string, do func(*http.Request) (*http.Response // were waiting for refreshLock return header, body, nil } - // 0.0.0.0 is just a placeholder here -- do(), which is + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute)) + defer cancel() + // 0.0.0.0:0 is just a placeholder here -- do(), which is // localClusterRequest(), will replace the scheme and host // parts with the real proxy destination. - req, err := http.NewRequest(http.MethodGet, "http://0.0.0.0/"+path, nil) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://0.0.0.0:0/"+path, nil) if err != nil { return nil, nil, err } -- 2.39.5