-
Notifications
You must be signed in to change notification settings - Fork 129
feat(flowcontrol): Introduce ManagedQueue and Service Contracts #1174
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
feat(flowcontrol): Introduce ManagedQueue and Service Contracts #1174
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi @LukeAVanDrie. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/lgtm |
/lgtm Thanks Luke! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, LukeAVanDrie The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This commit introduces the foundational layer for the Flow Registry, which will act as the stateful control plane for managing queues and policies. It defines the `ManagedQueue` decorator, refines the system's core service contracts, and simplifies the queue plugin interface. The key changes are: 1. **`ports` -> `contracts` Rename**: The `ports` package is renamed to `contracts` to more accurately reflect the "Ports and Adapters" architectural pattern and avoid confusion with network ports. 2. **`ManagedQueue` Introduction**: A new `registry.managedQueue` component is introduced. It acts as a stateful decorator around a `framework.SafeQueue`, adding critical registry-level functionality: - **Atomic Statistics**: It maintains its own atomic `len` and `byteSize` counters. - **State Reconciliation**: It uses a callback to propagate statistical deltas to its parent (the future `RegistryShard`), ensuring aggregated stats remain consistent without locks. 3. **`SafeQueue` Interface Simplification**: The `framework.SafeQueue` interface is simplified. The `Add` and `Remove` methods no longer return the new queue state, as this responsibility is now correctly handled by the `ManagedQueue` decorator. This makes the `SafeQueue` contract cleaner and more focused on its core queuing logic.
fc2588b
to
b3be747
Compare
/lgtm |
This work tracks #674
This PR introduces the foundational layer for the Flow Registry, which will act as the stateful control plane for managing queues and policies. It establishes the core service
contracts
for the system and provides theManagedQueue
, a stateful decorator that wraps queue plugins.This work is a prerequisite for the full
FlowRegistry
implementation.Key Changes:
ports
->contracts
Rename: Theports
package has been renamed tocontracts
to more accurately reflect its purpose in defining the service interfaces for our "Ports and Adapters" architecture. This avoids potential confusion with network-related "ports" in the Kubernetes ecosystem.ManagedQueue
Decorator: A newregistry.managedQueue
component is introduced. It follows the decorator pattern, wrapping aframework.SafeQueue
to add critical registry-level functionality without complicating the underlying queue interface:len
andbyteSize
counters for high-performance, lock-free reads (useful for efficient metric reporting and capacity checking logic).RegistryShard
), ensuring aggregated stats remain consistent.SafeQueue
Interface Simplification: To support theManagedQueue
decorator, theframework.SafeQueue
interface has been simplified. TheAdd
andRemove
methods no longer return the new queue state. This responsibility is now correctly handled by theManagedQueue
, making theSafeQueue
contract cleaner and more focused on its core queuing logic.