oxidecomputer / oxidecomputer/omicron

Sled Agent Cleanup: Specify types when setting SMF properties

Open
#4,090 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cleanup Sled Agent
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

https://github.com/oxidecomputer/omicron/blob/9700d4491909d9e4fc49677967b98e055840d963/sled-agent/src/smf_helper.rs#L66-L84

When the sled agent sets properties within zones, it uses a form of svccfg that omits types. This means that sled agent implicitly assumes the service (though the XML file, most likely) already has that property.

This isn't always true. As one such example, the tfport.xml and tfport-sofnpu-standalone.xml files got out-of-sync, and a property existed in one, but not the other.

If we forced callers to specify the type, we would:

  1. Be able to add properties that don't necessarily exist,
  2. Be able to validate the type, such that "if it disagreed with an existing property" we would throw an error.

Note: This is cleanup, and may be less relevant with the addition of self-assembling zones, as those should generally obviate the need to explicitly reach into zones and set properties.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sled-agent/src/smf_helper.rs at lines 66-84 and trace the callers that set SMF properties within zones. Specify property types at the call boundary, then ensure new properties can be added and conflicting types are rejected. The issue does not name tests, so inspect the existing SMF helper coverage before validating the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.