Skip to content

Commit 2c03ee7

Browse files
committed
epp: increase default FlowGCTimeout to 1h
This commit increases the default Flow Garbage Collection timeout from from 5 minutes to 1 hour. This serves as a mitigation for a race condition where requests pending in the queue for longer than the GC timeout (e.g., during scale-from-zero) could result in the underlying flow state being deleted while the request was still active.
1 parent 14598d2 commit 2c03ee7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/epp/flowcontrol/registry/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ const (
4646
defaultInitialShardCount int = 1
4747
// defaultFlowGCTimeout is the default duration of inactivity after which an idle flow is garbage collected.
4848
// This also serves as the interval for the periodic garbage collection scan.
49-
defaultFlowGCTimeout time.Duration = 5 * time.Minute
49+
// TODO:(https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/1982) revert to 5m once this GC
50+
// race condition is properly resolved.
51+
defaultFlowGCTimeout time.Duration = 1 * time.Hour
5052
// defaultEventChannelBufferSize is the default size of the buffered channel for control plane events.
5153
defaultEventChannelBufferSize int = 4096
5254
)
@@ -127,7 +129,7 @@ type Config struct {
127129

128130
// FlowGCTimeout defines the interval at which the registry scans for and garbage collects idle flows.
129131
// A flow is collected if it has been observed to be Idle for at least one full scan interval.
130-
// Optional: Defaults to `defaultFlowGCTimeout` (5 minutes).
132+
// Optional: Defaults to `defaultFlowGCTimeout` (1 hour).
131133
FlowGCTimeout time.Duration
132134

133135
// EventChannelBufferSize defines the size of the buffered channel used for internal control plane events.

0 commit comments

Comments
 (0)