You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should discuss the deadline semantics for an InteractiveMode RayJob waiting for the user to provide spec.jobId.
The requirement is behavioral, not a predetermined API shape:
After the RayCluster becomes Ready and the RayJob enters Waiting, allow a configured amount of time for spec.jobId to be provided. Resource queueing and RayCluster startup must not consume this Waiting window. If no job ID is provided before the deadline, fail the RayJob with a clear reason and use the normal terminal cleanup path.
This issue intentionally does not assume that adding a field is necessarily the right solution. We should decide whether the existing field should change, whether deadlines should be split, or whether another API shape is preferable.
Current behavior on master
As of feeaf72facab4881ba2b179248bb67315634e229 (2026-08-19):
ray-operator/apis/ray/v1/rayjob_types.go:283-290 documents preRunningDeadlineSeconds as starting from status.startTime and covering both Initializing and Waiting.
ray-operator/controllers/ray/rayjob_controller.go:885-917 sets status.startTime during New to Initializing.
rayjob_controller.go:175-225 checks the same deadline in Initializing before RayCluster readiness, and lines 237-249 check it again in Waiting.
rayjob_controller.go:1247-1261 always calculates the deadline from status.startTime.
Therefore an InteractiveMode RayJob can reach Waiting with part or all of its configured budget consumed by scheduling and cluster startup. This differs from measuring how long the user has failed to complete the InteractiveMode handoff.
API questions to discuss
Possible directions include, but are not limited to:
Change the existing field semantics for InteractiveMode so preRunningDeadlineSeconds starts when it enters Waiting, while retaining initialization-based behavior for other modes. This avoids another field but gives one field mode-dependent meanings.
Keep the current broad field and add a Waiting-only field. This is backward compatible but increases API surface and overlapping deadlines.
Replace or deprecate the combined field in favor of phase-specific deadlines, such as separate Initializing and Waiting deadlines. This is clearer but needs migration and versioning.
Are Initializing and Waiting one pre-running phase with a shared budget, or distinct phases needing independent budgets?
Is a submission-mode-dependent start point acceptable for preRunningDeadlineSeconds?
If deadlines are split, should the current field remain, be deprecated, or be replaced?
How should configurations containing both broad and phase-specific deadlines behave?
What transition timestamp should be persisted so the timer survives reconciliation and operator restarts?
Invariants regardless of API shape
The requested Waiting budget starts when the ready RayCluster causes the RayJob to enter JobDeploymentStatusWaiting, not at initial RayJob initialization.
It applies only while spec.jobId remains empty. If the ID is present when reconciling, use the real ID rather than fail or synthesize another one.
On timeout, set status.jobDeploymentStatus: Failed, use a dedicated reason and clear message, and do not fabricate status.jobId or status.jobStatus.
Reuse the existing terminal path for status.endTime, deletion rules, TTL, and shutdownAfterJobFinishes; do not add separate RayCluster deletion logic.
Use case
We create an InteractiveMode RayJob, wait for its RayCluster to become usable, submit the real business job externally, and write that submission ID to spec.jobId. If the external handoff never happens, the RayCluster should eventually be released. The user needs the full configured handoff window after readiness; variable scheduling and startup latency should not consume it.
Using an HTTPMode placeholder or monitor is not equivalent. Non-Interactive modes assign the submitted placeholder ID to status.jobId, and the controller copies that Ray job status into status.jobStatus. Those fields would describe the monitor rather than the real business job.
Search before asking
RayJobwithWaitingstatus needs a ttl mechanism #4037, closed by [Feat] Rayjob add ttl before running state #4525, but the merged behavior starts timing at RayJob initialization rather than when InteractiveMode enters Waiting. I found no open issue or PR discussing this semantic gap.KubeRay Component
ray-operator
Description
We should discuss the deadline semantics for an InteractiveMode RayJob waiting for the user to provide
spec.jobId.The requirement is behavioral, not a predetermined API shape:
This issue intentionally does not assume that adding a field is necessarily the right solution. We should decide whether the existing field should change, whether deadlines should be split, or whether another API shape is preferable.
Current behavior on master
As of
feeaf72facab4881ba2b179248bb67315634e229(2026-08-19):ray-operator/apis/ray/v1/rayjob_types.go:283-290documentspreRunningDeadlineSecondsas starting fromstatus.startTimeand covering both Initializing and Waiting.ray-operator/controllers/ray/rayjob_controller.go:885-917setsstatus.startTimeduring New to Initializing.rayjob_controller.go:175-225checks the same deadline in Initializing before RayCluster readiness, and lines 237-249 check it again in Waiting.rayjob_controller.go:1247-1261always calculates the deadline fromstatus.startTime.Therefore an InteractiveMode RayJob can reach Waiting with part or all of its configured budget consumed by scheduling and cluster startup. This differs from measuring how long the user has failed to complete the InteractiveMode handoff.
API questions to discuss
Possible directions include, but are not limited to:
preRunningDeadlineSecondsstarts when it enters Waiting, while retaining initialization-based behavior for other modes. This avoids another field but gives one field mode-dependent meanings.RayJobwithWaitingstatus needs a ttl mechanism #4037 request but changes the behavior added for [Feature] RayJob with Initializing status needs a ttl mechanism #4178.Questions for maintainers:
preRunningDeadlineSeconds?Invariants regardless of API shape
JobDeploymentStatusWaiting, not at initial RayJob initialization.spec.jobIdremains empty. If the ID is present when reconciling, use the real ID rather than fail or synthesize another one.status.jobDeploymentStatus: Failed, use a dedicated reason and clear message, and do not fabricatestatus.jobIdorstatus.jobStatus.status.endTime, deletion rules, TTL, andshutdownAfterJobFinishes; do not add separate RayCluster deletion logic.Use case
We create an InteractiveMode RayJob, wait for its RayCluster to become usable, submit the real business job externally, and write that submission ID to
spec.jobId. If the external handoff never happens, the RayCluster should eventually be released. The user needs the full configured handoff window after readiness; variable scheduling and startup latency should not consume it.Using an HTTPMode placeholder or monitor is not equivalent. Non-Interactive modes assign the submitted placeholder ID to
status.jobId, and the controller copies that Ray job status intostatus.jobStatus. Those fields would describe the monitor rather than the real business job.Related issues
RayJobwithWaitingstatus needs a ttl mechanism #4037 requested a TTL for InteractiveMode Waiting and was closed by [Feat] Rayjob add ttl before running state #4525.preRunningDeadlineSecondsas a combined Initializing/Waiting deadline.spec.jobIdsupplied by the user.Are you willing to submit a PR?