Skip to content

Commit 3fa7dde

Browse files
authored
Merge branch 'main' into ashar/hybrid-concurrency-detector
2 parents 7775cbf + f83049f commit 3fa7dde

8 files changed

Lines changed: 19 additions & 13 deletions

File tree

pkg/epp/flowcontrol/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ their justifications, please refer to the detailed documentation within the rele
9999
processing loop. It manages a worker that distributes incoming requests, apply policies, and dispatch
100100
requests to the backends. Its design focuses on high throughput and backpressure.
101101

102-
2. **Pluggable `Policy` Framework (`./framework`)**: This defines the core interfaces for all pluggable logic. It
103-
features a two-tier policy system for `Fairness` (decisions *between* different flows) and `Ordering`
104-
(decisions *within* a single flow) logic, covering both request dispatch and displacement.
105-
106-
3. **Extensible `SafeQueue` System (`./framework`)**: This defines the `framework.SafeQueue` interface for
107-
concurrent-safe request storage. It uses a `QueueCapability` system that allows for diverse and extensible queue
108-
implementations (e.g., FIFO, Priority Heap) while maintaining a stable interface.
102+
2. **Pluggable `Policy` Contracts (`/pkg/epp/framework/interface/flowcontrol`)**: The plugin SDK defines the core
103+
interfaces for all pluggable logic. It features a two-tier policy system for `Fairness` (decisions *between*
104+
different flows) and `Ordering` (decisions *within* a single flow) logic, covering both request dispatch and
105+
displacement.
106+
107+
3. **The `SafeQueue` (`./contracts`, `./queue`)**: The `contracts.SafeQueue` interface defines concurrent-safe
108+
request storage, and `./queue` provides the priority-queue implementation whose dispatch order is determined by
109+
the flow's configured `OrderingPolicy`.
109110

110111
4. **The `FlowRegistry` (`./registry`, `./contracts`)**: This is the stateful control plane of the system. It manages
111112
the configuration and lifecycle of all flows, policies, and queues. It presents a view of its state to the
File renamed without changes.
File renamed without changes.

pkg/epp/flowcontrol/framework/plugins/queue/priorityqueue_test.go renamed to pkg/epp/flowcontrol/queue/priorityqueue_test.go

File renamed without changes.

pkg/epp/flowcontrol/registry/managedqueue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828

2929
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts"
3030
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts/mocks"
31-
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/framework/plugins/queue"
31+
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/queue"
3232
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol"
3333
fwkfcmocks "github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol/mocks"
3434
)

pkg/epp/flowcontrol/registry/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
"github.com/llm-d/llm-d-router/pkg/common/observability/logging"
3232
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts"
33-
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/framework/plugins/queue"
33+
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/queue"
3434
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol"
3535
"github.com/llm-d/llm-d-router/pkg/epp/metrics"
3636
)

pkg/epp/flowcontrol/registry/registry_helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
testclock "k8s.io/utils/clock/testing"
2929

3030
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/contracts"
31-
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/framework/plugins/queue"
31+
"github.com/llm-d/llm-d-router/pkg/epp/flowcontrol/queue"
3232
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol"
3333
"github.com/llm-d/llm-d-router/pkg/epp/framework/interface/flowcontrol/mocks"
3434
)

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)