Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/epp/flowcontrol/contracts/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ var (

// ErrInvalidShardCount indicates that an invalid shard count was provided (e.g., zero or negative).
ErrInvalidShardCount = errors.New("invalid shard count")

// ErrShardDraining indicates that an operation could not be completed because the target shard is in the process of
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This becomes the responsibility of the controller.FlowController which distributes requests across workers.

// being gracefully drained. The caller should retry the operation on a different, Active shard.
ErrShardDraining = errors.New("shard is draining")
)
12 changes: 7 additions & 5 deletions pkg/epp/flowcontrol/contracts/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,16 @@ type RegistryShard interface {
Stats() ShardStats
}

// ManagedQueue defines the interface for a flow's queue instance on a specific shard.
// It acts as a stateful decorator around an underlying `framework.SafeQueue`.
// ManagedQueue defines the interface for a flow's queue on a specific shard.
// It acts as a stateful decorator around an underlying `framework.SafeQueue`, augmenting it with statistics tracking.
//
// # Conformance
//
// - All methods MUST be goroutine-safe.
// - All mutating methods (`Add()`, `Remove()`, etc.) MUST ensure that the underlying queue state and the statistics
// (`Len`, `ByteSize`) are updated atomically relative to each other.
// - Implementations MUST be goroutine-safe.
// - All mutating methods MUST ensure that the underlying queue state and the public statistics (`Len`, `ByteSize`)
// are updated as a single atomic transaction.
// - The `Add` method MUST return an error wrapping `ErrShardDraining` if the queue instance belongs to a parent shard
// that is no longer Active.
type ManagedQueue interface {
framework.SafeQueue

Expand Down
127 changes: 0 additions & 127 deletions pkg/epp/flowcontrol/registry/events.go

This file was deleted.

56 changes: 0 additions & 56 deletions pkg/epp/flowcontrol/registry/lifecycle.go

This file was deleted.

Loading