Skip to content
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

lxd: Fix deviceEventListener resource scheduling when joining cluster #11899

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

tomponline
Copy link
Member

@tomponline tomponline commented Jun 27, 2023

Pass deviceEventListener a function that can get a fresh copy of state, rather than using a long held version, which can become out of date.

This manifested itself in no container CPU scheduling being run for instances launched on a server that had just joined a cluster.

This was because the ServerName property in the state.State object deviceEventListener was passed on LXD start up contained "none" but after the server had joined the cluster its ServerName changed to its cluster member name.

This then meant that the instance.LoadNodeAll() call used inside deviceEventListener was filtering instances that were on server "none", of which there weren't any because the new instances were associated with the cluster member's name.

This then meant that those instances did not get their CPU scheduling configured until LXD was next reloaded.

@tomponline tomponline self-assigned this Jun 27, 2023
By passing deviceEventListener a function that can get a fresh copy of state,
rather than using a long held version, which can become out of date.

This manifested itself in no container CPU scheduling being run for instances
launched on a server that had just joined a cluster.

This was because the ServerName property in the state.State object deviceEventListener
was passed on LXD start up contained "none" but after the server had joined the cluster
its ServerName changed to its cluster member name.

This then meant that the instance.LoadNodeAll() call used inside deviceEventListener
was filtering instances that were on server "none", of which there weren't any because
the new instances were associated with the cluster member's name.

This then meant that those instances did not get their CPU scheduling configured until
LXD was next reloaded.

Signed-off-by: Thomas Parrott <[email protected]>
@tomponline tomponline force-pushed the tp-cluster-cpu-scheduling branch from cf7fe65 to 2126d73 Compare June 27, 2023 16:01
@tomponline tomponline requested a review from MusicDin June 27, 2023 16:02
Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

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

LGTM

@tomponline tomponline merged commit 27d54ad into canonical:master Jun 27, 2023
@tomponline tomponline deleted the tp-cluster-cpu-scheduling branch June 27, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants