Skip to content

[v15] Prevent deadlock on moderated sessions when mod connection drops#36916

Merged
tigrato merged 1 commit intobranch/v15from
bot/backport-36882-branch/v15
Jan 19, 2024
Merged

[v15] Prevent deadlock on moderated sessions when mod connection drops#36916
tigrato merged 1 commit intobranch/v15from
bot/backport-36882-branch/v15

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Jan 19, 2024

Backport #36882 to branch/v15

changelog: Ensure that moderated sessions do not get stuck in the event of an unexpected drop in the moderator's connection.

This PR removes a deadlock caused by the moderator leaving the session
because his connection drops.

`OnWriteError` was called under lock which creates an issue if the
function calls `Termnager.DeleteWriter` to exclude the writter from the
term manager.

This PR also correctly forwards errors to the clients when they occur.

Changelog: Ensure that moderated sessions do not get stuck in the event of an unexpected drop in the moderator's connection.

Fixes #36881

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Comment thread lib/srv/termmanager.go
Comment on lines +102 to +105
var toDelete []struct {
key string
err error
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just for future reference, you can do something like this:

	type deleteKey struct {
		key string
		err error
	}
	var toDelete []deleteKey

so you don't have to keep re-defining the struct everywhere.

@tigrato tigrato added this pull request to the merge queue Jan 19, 2024
Merged via the queue into branch/v15 with commit 978036b Jan 19, 2024
@tigrato tigrato deleted the bot/backport-36882-branch/v15 branch January 19, 2024 15:33
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