Skip to content

Commit f83049f

Browse files
authored
docs: require monotone ceilings in UsageLimitPolicy contract (#2149)
* docs: require monotone ceilings in UsageLimitPolicy contract The dispatch loop stops at the first gated band, so a lower band whose ceiling exceeds a higher band's can be marked open on calls where it is never reached and starve. State this requirement in the interface contract so implementations do not have to discover it from the dispatch loop. Signed-off-by: Luke Van Drie <lukevandrie@google.com> * docs: state ceiling ordering direction explicitly in UsageLimitPolicy contract Signed-off-by: Luke Van Drie <lukevandrie@google.com> --------- Signed-off-by: Luke Van Drie <lukevandrie@google.com>
1 parent 64279b2 commit f83049f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

pkg/epp/framework/interface/flowcontrol/plugins.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,14 @@ type SaturationDetector interface {
144144
// Integration:
145145
// This policy is called during dispatch decision-making, before a request is allowed to proceed. For each
146146
// priority band, the returned ceiling is compared against current saturation. If saturation exceeds the
147-
// ceiling for a given priority, requests at that priority are gated (not dispatched).
148-
//
149-
// Conformance: Implementations MUST ensure all methods are goroutine-safe.
147+
// ceiling for a given priority, requests at that priority are gated (not dispatched). The dispatch loop
148+
// visits bands from highest to lowest priority and stops at the first gated band; lower bands are not
149+
// considered on that call.
150+
//
151+
// Conformance: Implementations MUST ensure all methods are goroutine-safe. Returned ceilings MUST be
152+
// monotonically non-increasing in the given priority order (highest priority first): because the
153+
// dispatch loop stops at the first gated band, a lower band whose ceiling exceeds that of a higher band
154+
// can be marked open on calls where it is unreachable, starving it.
150155
type UsageLimitPolicy interface {
151156
plugin.Plugin
152157

0 commit comments

Comments
 (0)