Skip to content

[v17] Implement Compaction of Desktop Shared Directory Read/Write Events#58445

Merged
rhammonds-teleport merged 1 commit intobranch/v17from
bot/backport-57815-branch/v17
Sep 2, 2025
Merged

[v17] Implement Compaction of Desktop Shared Directory Read/Write Events#58445
rhammonds-teleport merged 1 commit intobranch/v17from
bot/backport-57815-branch/v17

Conversation

@rhammonds-teleport
Copy link
Copy Markdown
Contributor

Backport #57815 to branch/v17

changelog: Reduce audit log clutter by compacting contiguous shared directory read/write events into a single audit log event.

…eads and writes

Attempt #2. Read requests for a given copy operation can arrive out of order. Adjusted this approach to record all read/write events within a given time period, then find the longest contiguous set of reads/writes that can be joined into a single audit event before emitting  audit event(s).

bit of cleanup

A bit of code cleanup plus extra test case. Removed timestamps from testing since the compaction algorithm can't really guarantee which segments will get grouped together.

Fix racy tests by bringing assertions into synctest bubble and using 'flush' for syncronization. Also add more thorough test cases for timer expiration and flush behavior.

lint fixes

Add license header

Replace unnecessary sort with 'slices.Min'

Apply suggestions from code review

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

Rename 'evnt' -> 'event'

Return iterator instead of slice

Abandon 'stream' terminology in favor of 'fileOperationsBucket'. This might be a better name since the code is basically sorting audit events  into a set of 'buckets' and attempting to compact each bucket of events later on.

Add a few comments
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from probakowski August 29, 2025 01:27
@rhammonds-teleport rhammonds-teleport added this pull request to the merge queue Sep 2, 2025
Merged via the queue into branch/v17 with commit bf95607 Sep 2, 2025
40 checks passed
@rhammonds-teleport rhammonds-teleport deleted the bot/backport-57815-branch/v17 branch September 2, 2025 14:44
@fheinecke fheinecke mentioned this pull request Sep 2, 2025
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