Determine session type on stream based on stream watcher events#50395
Merged
gabrielcorado merged 7 commits intomasterfrom Dec 27, 2024
Merged
Conversation
greedy52
reviewed
Dec 18, 2024
Comment on lines
+548
to
+549
| sessionStartCh := make(chan apievents.AuditEvent, 1) | ||
| if watcher, err := EventsWatcherFromContext(ctx); err == nil { |
Contributor
There was a problem hiding this comment.
error cases above are missing the callback?
Contributor
Author
There was a problem hiding this comment.
Updated it. Now the error cases closes the channel (causing the callback to called if any).
zmb3
reviewed
Dec 18, 2024
Collaborator
|
I haven't forgot about you @gabrielcorado - this is on my list to review/test later today! |
zmb3
approved these changes
Dec 23, 2024
greedy52
approved these changes
Dec 27, 2024
|
@gabrielcorado See the table below for backport results.
|
gabrielcorado
added a commit
that referenced
this pull request
Dec 27, 2024
* refactor: determine session type on stream based on watcher * refactor(auth): early return when is teleport server * refactor: move to function and add tests * chore(lib): fix lint * refactor(events): make private function
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Dec 28, 2024
…) (#50592) * refactor: determine session type on stream based on watcher * refactor(auth): early return when is teleport server * refactor: move to function and add tests * chore(lib): fix lint * refactor(events): make private function
gabrielcorado
added a commit
that referenced
this pull request
Jan 31, 2025
carloscastrojumo
pushed a commit
to carloscastrojumo/teleport
that referenced
this pull request
Feb 19, 2025
…itational#50395) * refactor: determine session type on stream based on watcher * refactor(auth): early return when is teleport server * refactor: move to function and add tests * chore(lib): fix lint * refactor(events): make private function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #49164
Brief context: After the changes are made at #47309, when a request for session recording events (playback) is made, we query to find the last event to set the
SessionTypefield on the audit log. Depending on the cluster's backend and the volume of audit events, this can cause increased latency.This PR updates the logic determining the session type for the
SessionRecordingAccessaudit event to receive a callback from the streamer when the first event is available.changelog: Improve session playback initial delay caused by an additional events query.