Skip to content

[v13] Fix incorrect Kubernetes event watcher chunking#35196

Merged
tigrato merged 1 commit intobranch/v13from
bot/backport-34981-branch/v13
Nov 30, 2023
Merged

[v13] Fix incorrect Kubernetes event watcher chunking#35196
tigrato merged 1 commit intobranch/v13from
bot/backport-34981-branch/v13

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Nov 30, 2023

Backport #34981 to branch/v13

Changelog: Improved streaming event handling for Kubernetes API by flushing response after each event, ensuring complete, well-formed chunks.

Improve handling of streaming events in response to non-chunked content-type from the Kubernetes API.

Previously, when dealing with streaming events, the code streamed the response into the target connection.
However, the Kubernetes API did not provide the content-type as chunked.
This lack of information caused the forwarder to be unaware that the connection was chunked.
Consequently, the forwarder delayed response writing by buffering it, intending to minimize the number of writes.

In scenarios where the connection stream was busy with events, users might not receive individual events as chunks,
leading to incomplete data. This could result in users receiving malformed JSON, triggering an abort of the process.

To address this issue, this commit introduces a modification. After each event, the response is now flushed to ensure
that users receive the event as a complete and well-formed chunk.
This adjustment improves the reliability and integrity of the data received by users during streaming events.

Fixes #34977

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@tigrato tigrato enabled auto-merge November 30, 2023 16:37
@tigrato tigrato added this pull request to the merge queue Nov 30, 2023
Merged via the queue into branch/v13 with commit b92c7fd Nov 30, 2023
@tigrato tigrato deleted the bot/backport-34981-branch/v13 branch November 30, 2023 17:51
@camscale camscale mentioned this pull request Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants