Skip to content

fix: fixes a possible deadlock in kube moderator joining#54500

Merged
tigrato merged 2 commits intomasterfrom
tigrato/fix-resize-loop
May 5, 2025
Merged

fix: fixes a possible deadlock in kube moderator joining#54500
tigrato merged 2 commits intomasterfrom
tigrato/fix-resize-loop

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented May 3, 2025

This PR addresses a bug in the Kubernetes session join logic where a joined session could hang under specific conditions. The issue occurred when one or more peers triggered multiple terminal resize events in succession.

The client handling the resize was only performing a single resize operation and failing to respond to subsequent events, resulting in the terminal becoming unresponsive. This led to a state where session data was no longer displayed to moderators or observers, effectively freezing the shared session view. The fix ensures proper handling of repeated resize events to maintain session responsiveness and continuity.

Changelog: Fixed a possible moderator/observer terminal freeze when joining a Kubernetes moderated session.

This PR addresses a bug in the Kubernetes session join logic where a joined session could hang under specific conditions. The issue occurred when one or more peers triggered multiple terminal resize events in rapid succession.

The client handling the resize was only performing a single resize operation and failing to respond to subsequent events, resulting in the terminal becoming unresponsive. This led to a state where session data was no longer displayed to moderators or observers, effectively freezing the shared session view. The fix ensures proper handling of repeated resize events to maintain session responsiveness and continuity.

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

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good. If there's a way to get some test coverage on this we could always use more tests for moderation.

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from boxofrad May 5, 2025 12:22
Comment thread lib/client/kubesession.go Outdated
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
@tigrato
Copy link
Copy Markdown
Contributor Author

tigrato commented May 5, 2025

Change looks good. If there's a way to get some test coverage on this we could always use more tests for moderation.

I can take a look later but I think it requires a bit of work. This code isn't directly tested. Even integration tests use a custom client.

@tigrato tigrato enabled auto-merge May 5, 2025 15:36
@tigrato tigrato added this pull request to the merge queue May 5, 2025
Merged via the queue into master with commit c16b6c1 May 5, 2025
40 checks passed
@tigrato tigrato deleted the tigrato/fix-resize-loop branch May 5, 2025 20:07
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@tigrato See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Create PR
branch/v17 Create PR

tigrato added a commit that referenced this pull request May 5, 2025
* fix: fixes a possible deadlock in kube moderator joining

This PR addresses a bug in the Kubernetes session join logic where a joined session could hang under specific conditions. The issue occurred when one or more peers triggered multiple terminal resize events in rapid succession.

The client handling the resize was only performing a single resize operation and failing to respond to subsequent events, resulting in the terminal becoming unresponsive. This led to a state where session data was no longer displayed to moderators or observers, effectively freezing the shared session view. The fix ensures proper handling of repeated resize events to maintain session responsiveness and continuity.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* Update lib/client/kubesession.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
github-merge-queue Bot pushed a commit that referenced this pull request May 9, 2025
* fix: fixes a possible deadlock in kube moderator joining (#54500)

* fix: fixes a possible deadlock in kube moderator joining

This PR addresses a bug in the Kubernetes session join logic where a joined session could hang under specific conditions. The issue occurred when one or more peers triggered multiple terminal resize events in rapid succession.

The client handling the resize was only performing a single resize operation and failing to respond to subsequent events, resulting in the terminal becoming unresponsive. This led to a state where session data was no longer displayed to moderators or observers, effectively freezing the shared session view. The fix ensures proper handling of repeated resize events to maintain session responsiveness and continuity.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* Update lib/client/kubesession.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* fix

* fix

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
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