summaryrefslogtreecommitdiffhomepage
path: root/control/controlknobs
diff options
context:
space:
mode:
authorTom Proctor <tomhjp@users.noreply.github.com>2025-07-28 12:03:08 +0100
committerGitHub <noreply@github.com>2025-07-28 12:03:08 +0100
commit02084629e208db6e7601a00777619697b49ac770 (patch)
tree6f8ebd012ba3b499766b62105adeefe31c9ec56c /control/controlknobs
parent57318695656ec693f75fc858ea853ee4c4591f57 (diff)
downloadtailscale-02084629e208db6e7601a00777619697b49ac770.tar.xz
tailscale-02084629e208db6e7601a00777619697b49ac770.zip
k8s-operator: handle multiple WebSocket frames per read (#16678)
When kubectl starts an interactive attach session, it sends 2 resize messages in quick succession. It seems that particularly in HTTP mode, we often receive both of these WebSocket frames from the underlying connection in a single read. However, our parser currently assumes 0-1 frames per read, and leaves the second frame in the read buffer until the next read from the underlying connection. It doesn't take long after that before we end up failing to skip a control message as we normally should, and then we parse a control message as though it will have a stream ID (part of the Kubernetes protocol) and error out. Instead, we should keep parsing frames from the read buffer for as long as we're able to parse complete frames, so this commit refactors the messages parsing logic into a loop based on the contents of the read buffer being non-empty. k/k staging/src/k8s.io/kubectl/pkg/cmd/attach/attach.go for full details of the resize messages. There are at least a couple more multiple-frame read edge cases we should handle, but this commit is very conservatively fixing a single observed issue to make it a low-risk candidate for cherry picking. Updates #13358 Change-Id: Iafb91ad1cbeed9c5231a1525d4563164fc1f002f Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
Diffstat (limited to 'control/controlknobs')
0 files changed, 0 insertions, 0 deletions