volcano icon indicating copy to clipboard operation
volcano copied to clipboard

queue update request occured error, when queue state in closing

Open flyingfang opened this issue 1 year ago • 2 comments

We intended to prohibit the scheduling of new tasks to the queue by closing it. However, when there are already scheduled tasks in the queue, its status changes to “closing”. At this point, if we attempt to update queue metadata, such as adjusting quotas, our modification requests would be intercepted with a prompt "queue state must be in [Open, Closed]".

Why are modifications not allowed for a queue in the ‘closing’ state?

close queue states, code snippet:

	case v1alpha1.CloseQueueAction:
		return SyncQueue(cs.queue, func(status *v1beta1.QueueStatus, podGroupList []string) {
			if len(podGroupList) == 0 {
				status.State = v1beta1.QueueStateClosed
				return
			}
			status.State = v1beta1.QueueStateClosing
		})

webhook validate queue states, code snippet:

func validateStateOfQueue(value schedulingv1beta1.QueueState, fldPath *field.Path) field.ErrorList {
	errs := field.ErrorList{}

	if len(value) == 0 {
		return errs
	}

	validQueueStates := []schedulingv1beta1.QueueState{
		schedulingv1beta1.QueueStateOpen,
		schedulingv1beta1.QueueStateClosed,
	}

	for _, validQueue := range validQueueStates {
		if value == validQueue {
			return errs
		}
	}

	return append(errs, field.Invalid(fldPath, value, fmt.Sprintf("queue state must be in %v", validQueueStates)))
}

flyingfang avatar Jun 12 '24 04:06 flyingfang

closing is an intermediate state of open and close,it means that the queue will be in close soon and terminate its lifecycyle, so it's not allowed to modify,in your case,it seems that you just want to suspend the queue and not terminate it,so maybe add another state like pending can meet your need. Please refer to https://github.com/volcano-sh/volcano/blob/master/docs/design/queue/queue-state-management.md for more details.

Monokaix avatar Jun 14 '24 04:06 Monokaix

@Monokaix Do we have plans to expand the status of the queue? For example, by adding a pending status?Later, we reconsidered our scenario. Our main objective is simply to be able to pause tasks from entering the queue, so as to achieve the purpose of reducing the queue’s capacity or allocation.We can also provide other solutions for safely reducing the allocation or capacity.

flyingfang avatar Sep 11 '24 02:09 flyingfang

Hello 👋 Looks like there was no activity on this issue for last 90 days. Do you mind updating us on the status? Is this still reproducible or needed? If yes, just comment on this PR or push a commit. Thanks! 🤗 If there will be no activity for 60 days, this issue will be closed (we can always reopen an issue if we need!).

stale[bot] avatar Feb 01 '25 01:02 stale[bot]

Closing for now as there was no activity for last 90 days after marked as stale, let us know if you need this to be reopened! 🤗

stale[bot] avatar May 06 '25 02:05 stale[bot]