Skip to content

Commit

Permalink
[Hotfix][release blocker][RayJob] HTTP client from submitting jobs be…
Browse files Browse the repository at this point in the history
…fore dashboard initialization completes (ray-project#1000)

HTTP client from submitting jobs before dashboard initialization completes
  • Loading branch information
kevin85421 authored Mar 31, 2023
1 parent 65c1e7e commit 024e41f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ray-operator/controllers/ray/utils/dashboard_httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 024e41f

Please sign in to comment.