Skip to content

Commit 42117c3

Browse files
committed
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>
1 parent 2ef2adf commit 42117c3

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

0 commit comments

Comments
 (0)