-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine session type on stream based on stream watcher events #50395
base: master
Are you sure you want to change the base?
Determine session type on stream based on stream watcher events #50395
Conversation
lib/events/auditlog.go
Outdated
sessionStartCh := make(chan apievents.AuditEvent, 1) | ||
if watcher, err := EventsWatcherFromContext(ctx); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error cases above are missing the callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it. Now the error cases closes the channel (causing the callback to called if any).
I haven't forgot about you @gabrielcorado - this is on my list to review/test later today! |
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
SessionType
field 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
SessionRecordingAccess
audit 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.