Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin/trans: Unify handleReserve+handleRequested (#936)
This introduces a new method on resourceTransitioner[T], handleRequestedGeneric(), which implements a superset of the functionality needed by both handleReserve and handleRequested. The two latter methods now internally "just" call the new method, albeit with different parameterizations. --- Other changes: - The new method has a notion of "forced approval minimum", which sets the minimum value it must approve, even if the node would be over-budget. - This is used to retain the infallible behavior of handleReserve. - This is *also* used to move the lastPermit logic into handleRequested. - Because of the new forced approval minimum, handleLastPermit is no longer needed. --- In general, the motivation behind this change is to reduce the number of distinct implementations of resource logic, so there's fewer changes involved in implementing overcommit.
- Loading branch information