Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RayCluster controller] [Bug] Unconditionally reconcile RayCluster every 60s instead of only upon change #850

Merged
14 changes: 13 additions & 1 deletion ray-operator/controllers/ray/raycluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package ray
import (
"context"
"fmt"
"os"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -234,7 +236,17 @@ func (r *RayClusterReconciler) rayClusterReconcile(request ctrl.Request, instanc
}
}

return ctrl.Result{}, nil
// Unconditionally requeue after the number of seconds specified in the
// environment variable RAYCLUSTER_DEFAULT_RECONCILE_LOOP_S. If the
// environment variable is not set, requeue after 5 minutes.
var requeueAfterSeconds int
requeueAfterSeconds, err := strconv.Atoi(os.Getenv("RAYCLUSTER_DEFAULT_RECONCILE_LOOP_S"))
if err != nil {
r.Log.Info("RAYCLUSTER_DEFAULT_RECONCILE_LOOP_S is not set, using default value 300s", "cluster name", request.Name)
requeueAfterSeconds = 5 * 60
}
r.Log.Info("Unconditional requeue after", "cluster name", request.Name, "seconds", requeueAfterSeconds)
return ctrl.Result{RequeueAfter: time.Duration(requeueAfterSeconds) * time.Second}, nil
}

func (r *RayClusterReconciler) reconcileIngress(instance *rayiov1alpha1.RayCluster) error {
Expand Down