You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a configurable backend dial timeout for frontend dial requests. The option defaults to 0 to preserve existing behavior, and operators can opt in to bound DIAL_REQ send and DIAL_RSP wait time.
Clean up pending dials on timeout and report backend_dial_timeout as a dial failure reason. Add an HTTP CONNECT regression test for a blocked backend DIAL_REQ send.
Signed-off-by: DH Kim <inerplat@gmail.com>
Copy file name to clipboardExpand all lines: cmd/server/app/options/options.go
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,8 @@ type ProxyRunOptions struct {
122
122
NeedsKubernetesClientbool
123
123
// Graceful shutdown timeout duration
124
124
GracefulShutdownTimeout time.Duration
125
+
// Backend dial timeout duration for frontend dial requests
126
+
BackendDialTimeout time.Duration
125
127
}
126
128
127
129
func (o*ProxyRunOptions) Flags() *pflag.FlagSet {
@@ -164,6 +166,7 @@ func (o *ProxyRunOptions) Flags() *pflag.FlagSet {
164
166
flags.StringVar(&o.LeaseNamespace, "lease-namespace", o.LeaseNamespace, "The namespace where lease objects are managed by the controller.")
165
167
flags.StringVar(&o.LeaseLabel, "lease-label", o.LeaseLabel, "The labels on which the lease objects are managed.")
166
168
flags.DurationVar(&o.GracefulShutdownTimeout, "graceful-shutdown-timeout", o.GracefulShutdownTimeout, "Timeout duration for graceful shutdown of the server. The server will wait for active connections to close before forcefully terminating. Set to 0 to disable graceful shutdown (default: 0).")
169
+
flags.DurationVar(&o.BackendDialTimeout, "backend-dial-timeout", o.BackendDialTimeout, "Timeout duration for sending DIAL_REQ packets to backend agent streams and waiting for DIAL_RSP. Set to 0 to disable timeout.")
167
170
flags.Bool("warn-on-channel-limit", true, "This behavior is now thread safe and always on. This flag will be removed in a future release.")
168
171
flags.MarkDeprecated("warn-on-channel-limit", "This behavior is now thread safe and always on. This flag will be removed in a future release.")
169
172
@@ -209,6 +212,7 @@ func (o *ProxyRunOptions) Print() {
209
212
klog.V(1).Infof("TLSMinVersion set to %q.\n", o.TLSMinVersion)
210
213
klog.V(1).Infof("XfrChannelSize set to %d.\n", o.XfrChannelSize)
211
214
klog.V(1).Infof("GracefulShutdownTimeout set to %v.\n", o.GracefulShutdownTimeout)
215
+
klog.V(1).Infof("BackendDialTimeout set to %v.\n", o.BackendDialTimeout)
212
216
}
213
217
214
218
func (o*ProxyRunOptions) Validate() error {
@@ -368,6 +372,9 @@ func (o *ProxyRunOptions) Validate() error {
368
372
ifo.GracefulShutdownTimeout<0 {
369
373
returnfmt.Errorf("graceful-shutdown-timeout must be >= 0, got %v", o.GracefulShutdownTimeout)
370
374
}
375
+
ifo.BackendDialTimeout<0 {
376
+
returnfmt.Errorf("backend-dial-timeout must be >= 0, got %v", o.BackendDialTimeout)
0 commit comments