Skip to content

[sled-agent] sim: record attached subnets sent at VMM registration - #11576

Merged
sunshowers merged 2 commits into
sunshowers/spr/sled-agent-sim-make-simcollection-generic-over-a-typed-uuid-kindfrom
sunshowers/spr/sled-agent-sim-record-attached-subnets-sent-at-vmm-registration
Oct 23, 2026
Merged

sunshowers merged 2 commits into
sunshowers/spr/sled-agent-sim-make-simcollection-generic-over-a-typed-uuid-kindfrom
sunshowers/spr/sled-agent-sim-record-attached-subnets-sent-at-vmm-registration

Conversation

@sunshowers

Copy link
Copy Markdown
Contributor

This is the sled-agent-sim version of #11557.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please check the accuracy of this comment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Yeah, agreed that this is more general and that we should probably move things to be within a single lock.

@sunshowers
sunshowers merged commit 9dc2338 into main Oct 23, 2026
19 checks passed
@sunshowers
sunshowers deleted the sunshowers/spr/sled-agent-sim-record-attached-subnets-sent-at-vmm-registration branch October 23, 2026 18:29
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.

2 participants