Repository navigation
[sled-agent] sim: record attached subnets sent at VMM registration - #11576
Merged
Conversation
sunshowers
commented
Oct 23, 2026
Comment on lines
+109
to
+130
| // TODO: entries in this map can currently be stale because: | ||
| // | ||
| // * We don't always clean up attached subnets at VMM unregister | ||
| // time. instance_unregister cleans attached subnets up, but | ||
| // sim_poke -> ready_to_destroy does not. | ||
| // * instance_register can fail after the VMM is registered, | ||
| // which leaves it registered (with its entry) despite returning | ||
| // an error. | ||
| // | ||
| // There are multiple data modeling and code defects here: | ||
| // | ||
| // * Invalid states are representable at all (attached_subnets | ||
| // should not be a separate map). | ||
| // * Even if they're representable, these kinds of torn states | ||
| // should not be externally visible (there should be a single | ||
| // shared lock, or we should use the actor model). | ||
| // * instance_register (and other functions?) should be written | ||
| // in a prepare-and-commit style, where all prerequisites are | ||
| // checked first and then a second infallible section updates | ||
| // all state. | ||
| // | ||
| // We should fix all of this at some point. |
Contributor
Author
There was a problem hiding this comment.
Please check the accuracy of this comment.
Collaborator
There was a problem hiding this comment.
I think this is probably accurate. And also, (1) I don't know how the fallible operations can fail in practice, and (2) I think it applies to every field protected by a separate lock in this type.
Contributor
Author
There was a problem hiding this comment.
Thanks. Yeah, agreed that this is more general and that we should probably move things to be within a single lock.
bnaecker
approved these changes
Oct 23, 2026
sunshowers
deleted the
sunshowers/spr/sled-agent-sim-record-attached-subnets-sent-at-vmm-registration
branch
October 23, 2026 18:29
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.
This is the sled-agent-sim version of #11557.