timeout wait backend to frontend complete

Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
This commit is contained in:
zhangxiaoyu 2022-11-01 15:44:52 +08:00
parent 2d427ba547
commit f62feb5070
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 99ca0fbb527b3c3137d8ea16aa82db009517adf0 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 1 Nov 2022 15:34:16 +0800
Subject: [PATCH] timeout wait backend to frontend complete
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
pkg/kubelet/cri/streaming/remotecommand/proxy.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pkg/kubelet/cri/streaming/remotecommand/proxy.go b/pkg/kubelet/cri/streaming/remotecommand/proxy.go
index f21629af..65860c87 100644
--- a/pkg/kubelet/cri/streaming/remotecommand/proxy.go
+++ b/pkg/kubelet/cri/streaming/remotecommand/proxy.go
@@ -129,6 +129,11 @@ func ProxyToWebSocket(w http.ResponseWriter, r *http.Request, url *url.URL, opts
case <-frontendResizeToBackendComplete:
}
+ select {
+ case <-backendToFrontendComplete:
+ case <-time.Tick(5 * time.Second):
+ }
+
if errConnection != nil {
klog.Errorf("SpdyProxy: the connection disconnected: %v", errConnection)
if exitErr, ok := errConnection.(exec.ExitError); ok && exitErr.Exited() {
--
2.25.1

View File

@ -3,7 +3,7 @@
Name: kubernetes
Version: 1.20.2
Release: 10
Release: 11
Summary: Container cluster management
License: ASL 2.0
URL: https://k8s.io/kubernetes
@ -32,6 +32,7 @@ Patch6004: 0005-fix-CVE-2021-25741.patch
Patch6005: 0006-kubelet-support-attach-websocket-protocol.patch
Patch6006: 0007-Add-an-option-for-aggregator.patch
Patch6007: 0008-kubelet-fix-websocket-reference-nil-pointer.patch
Patch6008: 0009-timeout-wait-backend-to-frontend-complete.patch
%description
Container cluster management.
@ -263,6 +264,9 @@ getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
%systemd_postun kubelet kube-proxy
%changelog
* Tue Nov 01 2022 zhangxiaoyu <zhangxiaoyu58@huawei.com> - 1.20.2-11
- DESC: timeout wait backend to frontend complete
* Mon Oct 31 2022 zhangxiaoyu <zhangxiaoyu58@huawei.com> - 1.20.2-10
- DESC: kubelet fix websocket reference nul pointer