Skip to content

Improve the dynamic Windows desktop reconciler#57724

Merged
zmb3 merged 1 commit intomasterfrom
zmb3/dynamic-desktop
Aug 19, 2025
Merged

Improve the dynamic Windows desktop reconciler#57724
zmb3 merged 1 commit intomasterfrom
zmb3/dynamic-desktop

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Aug 8, 2025

Changelog: Fixed an issue that could cause some hosts not to register dynamic Windows desktops.

Comment thread lib/srv/desktop/discovery.go Outdated
Comment thread lib/srv/desktop/discovery.go Outdated
Comment thread lib/srv/desktop/discovery.go Outdated
@zmb3 zmb3 force-pushed the zmb3/dynamic-desktop branch from d50294f to 2d998f7 Compare August 9, 2025 00:27
@zmb3 zmb3 force-pushed the zmb3/dynamic-desktop branch 3 times, most recently from 89d567d to 7a082fe Compare August 18, 2025 22:23
@zmb3 zmb3 marked this pull request as ready for review August 18, 2025 22:23
@zmb3 zmb3 changed the title wip Improve the dynamic Windows desktop reconciler Aug 18, 2025
Comment on lines -391 to -397
maps.DeleteFunc(currentResources, func(_ string, v types.WindowsDesktop) bool {
d, err := s.cfg.AuthClient.GetWindowsDesktops(ctx, types.WindowsDesktopFilter{
HostID: v.GetHostID(),
Name: v.GetName(),
})
return err != nil || len(d) == 0
})
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was the problematic code. The rest of the changes in the PR are subtle improvements.

Comment thread lib/services/watcher.go Outdated
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from vapopov August 19, 2025 11:29
The reconciler runs in the Windows desktop service, watching for
dynamic_windows_desktop resources that match its configured labels,
and creating corresponding windows_desktop resources for any matches.

This change makes several improvements to the reconciler:

- emit a debug-level log entry showing how long the reconciliation took
- move more state into local variables in the reconciler goroutine
- ensure that we hit the local process cache instead of the backend
- remove a suspicious delete operation that seems to be unnecessary
  at best and actively harmful at worst

Co-authored-by: Tim Ross <tim.ross@goteleport.com>
@zmb3 zmb3 force-pushed the zmb3/dynamic-desktop branch from 7a082fe to 7f25446 Compare August 19, 2025 14:56
@zmb3 zmb3 enabled auto-merge August 19, 2025 14:56
@zmb3 zmb3 added this pull request to the merge queue Aug 19, 2025
Merged via the queue into master with commit a2d2959 Aug 19, 2025
42 of 43 checks passed
@zmb3 zmb3 deleted the zmb3/dynamic-desktop branch August 19, 2025 17:39
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@zmb3 See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Failed
branch/v18 Failed

mmcallister pushed a commit that referenced this pull request Sep 22, 2025
The reconciler runs in the Windows desktop service, watching for
dynamic_windows_desktop resources that match its configured labels,
and creating corresponding windows_desktop resources for any matches.

This change makes several improvements to the reconciler:

- emit a debug-level log entry showing how long the reconciliation took
- move more state into local variables in the reconciler goroutine
- ensure that we hit the local process cache instead of the backend
- remove a suspicious delete operation that seems to be unnecessary
  at best and actively harmful at worst

Co-authored-by: Tim Ross <tim.ross@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.

5 participants