Skip to content

Commit ac4c3c8

Browse files
authored
[RayJob] Remove updateJobStatus call (#4198)
Fast follow to #4191 Signed-off-by: Spencer Peterson <spencerjp@google.com>
1 parent cae2f51 commit ac4c3c8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ray-operator/controllers/ray/rayjob_controller.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
152152
rayJobInstance.Status.Reason = rayv1.ValidationFailed
153153
rayJobInstance.Status.Message = err.Error()
154154

155-
// This is one of the only 3 places where we update the RayJob status. This will directly
155+
// This is one of the only 2 places where we update the RayJob status. This will directly
156156
// update the JobDeploymentStatus to ValidationFailed if there's validation error.
157157
if err = r.updateRayJobStatus(ctx, originalRayJobInstance, rayJobInstance); err != nil {
158158
logger.Info("Failed to update RayJob status", "error", err)
@@ -204,13 +204,11 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
204204
if clientURL := rayJobInstance.Status.DashboardURL; clientURL == "" {
205205
if rayClusterInstance.Status.State != rayv1.Ready {
206206
logger.Info("Wait for the RayCluster.Status.State to be ready before submitting the job.", "RayCluster", rayClusterInstance.Name, "State", rayClusterInstance.Status.State)
207-
// This is one of only 3 places where we update the RayJob status. For observability
208-
// while waiting for the RayCluster to become ready, we lift the cluster status.
207+
// The nonready RayCluster status should be reflected in the RayJob's status.
208+
// Breaking from the switch statement will drop directly to the status update code
209+
// and return a default requeue duration and no error.
209210
rayJobInstance.Status.RayClusterStatus = rayClusterInstance.Status
210-
if err = r.updateRayJobStatus(ctx, originalRayJobInstance, rayJobInstance); err != nil {
211-
logger.Info("Failed to update RayJob status", "error", err)
212-
}
213-
return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, err
211+
break
214212
}
215213

216214
if clientURL, err = utils.FetchHeadServiceURL(ctx, r.Client, rayClusterInstance, utils.DashboardPortName); err != nil || clientURL == "" {
@@ -425,7 +423,7 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request)
425423
}
426424
checkBackoffLimitAndUpdateStatusIfNeeded(ctx, rayJobInstance)
427425

428-
// This is one of the only 3 places where we update the RayJob status. Please do NOT add any
426+
// This is one of the only 2 places where we update the RayJob status. Please do NOT add any
429427
// code between `checkBackoffLimitAndUpdateStatusIfNeeded` and the following code.
430428
if err = r.updateRayJobStatus(ctx, originalRayJobInstance, rayJobInstance); err != nil {
431429
logger.Info("Failed to update RayJob status", "error", err)

0 commit comments

Comments
 (0)