Skip to content

force release of quota when AW is deleted in target namespace #365

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

Closed
wants to merge 10 commits into from

Conversation

asm582
Copy link
Member

@asm582 asm582 commented May 11, 2023

No description provided.

@asm582 asm582 changed the title submit aw without quota force release of quota when AW is delete in target namespace May 16, 2023
@asm582 asm582 marked this pull request as ready for review May 16, 2023 16:13
Comment on lines 392 to 439
if err != nil {
return nil, fmt.Errorf("consumer %s already allocated on forest %s", consumerID, forestName)
} else {
//release quota
m.DeAllocateForest(forestName, consumerID)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused here. If the consumerID is allocated it is removed in the else, but if it's allocated and no AppWrapper is found for the consumerID then it isn't deallocated?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused too. The consumer shouldn't exist to begin with. So if it does, then that is an error. I get that from line 393. But then if it doesn't exist in the forest, then it is deallocated from the forest, where it doesn't exist?

Comment on lines 392 to 439
if err != nil {
return nil, fmt.Errorf("consumer %s already allocated on forest %s", consumerID, forestName)
} else {
//release quota
m.DeAllocateForest(forestName, consumerID)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused too. The consumer shouldn't exist to begin with. So if it does, then that is an error. I get that from line 393. But then if it doesn't exist in the forest, then it is deallocated from the forest, where it doesn't exist?

Copy link
Collaborator

@metalcycling metalcycling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line 404 where we deallocate the consumer if the AppWrapper doesn't exist, we should add a log. That is a really funky behavior that should be recorded somehow. Message could be [AllocateForest] Found consumer %v in quota tree but didn't find its matching AppWrapper. Deleting consumer from the tree. or something like it. I'll let you choose the logging level.

@asm582
Copy link
Member Author

asm582 commented May 17, 2023

[AllocateForest] Found consumer %v in quota tree but didn't find its matching AppWrapper. Deleting consumer from the tree.
Done, thanks

metalcycling
metalcycling previously approved these changes May 17, 2023
Copy link
Contributor

@z103cb z103cb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the logic for checking if the AW is a namespace does not belong to the qutamanger struct. It should be placed (if needed) a lot higher in the call chain: the Fits method call:
quotaFits, preemptAWs, msg := qjm.quotaManager.Fits(qj, aggqj, proposedPreemptions) or inside the method itself.

@asm582
Copy link
Member Author

asm582 commented May 19, 2023

I think that the logic for checking if the AW is a namespace does not belong to the qutamanger struct. It should be placed (if needed) a lot higher in the call chain: the Fits method call: quotaFits, preemptAWs, msg := qjm.quotaManager.Fits(qj, aggqj, proposedPreemptions) or inside the method itself.

Good Point, I will move the code higher up

@asm582 asm582 changed the title force release of quota when AW is delete in target namespace force release of quota when AW is deleted in target namespace May 19, 2023
@z103cb
Copy link
Contributor

z103cb commented May 23, 2023

@asm582, I think that issues #388 and #392 might be related to this issue.

@tardieu tardieu mentioned this pull request May 25, 2023
@@ -1267,7 +1269,9 @@ func (qjm *XController) ScheduleNext() {
if qjm.quotaManager != nil {
var msg string
var preemptAWs []*arbv1.AppWrapper
quotaFits, preemptAWs, msg = qjm.quotaManager.Fits(qj, aggqj, proposedPreemptions)
//quota trees fail to update with AW deletes, release quota before assigning
qjm.quotaManager.Release(qj)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this makes any sense here now, it seems superfluous. Have you observed a scenario where having this call here would be beneficial?

@tardieu
Copy link
Member

tardieu commented May 30, 2023

This PR should by replaced by #398 once completed.

@tardieu tardieu closed this May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

5 participants