From 024e41f7aa18174df37bed540613f5a76bcb5e53 Mon Sep 17 00:00:00 2001 From: Kai-Hsun Chen Date: Fri, 31 Mar 2023 14:02:44 -0700 Subject: [PATCH] [Hotfix][release blocker][RayJob] HTTP client from submitting jobs before dashboard initialization completes (#1000) HTTP client from submitting jobs before dashboard initialization completes --- ray-operator/controllers/ray/utils/dashboard_httpclient.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ray-operator/controllers/ray/utils/dashboard_httpclient.go b/ray-operator/controllers/ray/utils/dashboard_httpclient.go index 561e81013cc..bcad6617081 100644 --- a/ray-operator/controllers/ray/utils/dashboard_httpclient.go +++ b/ray-operator/controllers/ray/utils/dashboard_httpclient.go @@ -164,7 +164,7 @@ func FetchDashboardURL(ctx context.Context, log *logr.Logger, cli client.Client, func (r *RayDashboardClient) InitClient(url string) { r.client = http.Client{ - Timeout: 2 * time.Second, + Timeout: 120 * time.Second, } r.dashboardURL = "http://" + url } @@ -381,7 +381,8 @@ func (r *RayDashboardClient) SubmitJob(rayJob *rayv1alpha1.RayJob, log *logr.Log var jobResp RayJobResponse if err = json.Unmarshal(body, &jobResp); err != nil { - return + // Maybe body is not valid json, raise an error with the body. + return "", fmt.Errorf("SubmitJob fail: %s", string(body)) } return jobResp.JobId, nil