Skip to content

fix(cache): remove same-priority device conflicts - #144

Merged
zvonkok merged 1 commit into
cncf-tags:mainfrom
elezar:fix/cache-conflicting-devices
Aug 19, 2026
Merged

fix(cache): remove same-priority device conflicts#144
zvonkok merged 1 commit into
cncf-tags:mainfrom
elezar:fix/cache-conflicting-devices

Conversation

@elezar

@elezar elezar commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Make same-priority conflicts for a fully qualified CDI device name unresolvable after cache refresh. This aligns the Rust cache with the Go CDI cache, which removes conflicting names from the newly built local device map before installing it.

The Rust cache currently removes a conflict from self.devices and then overwrites that map with the rebuilt local devices map, leaving the conflict selectable despite refresh() reporting an error.

Related Issue

No issue required: localized cache correctness fix.

Changes

  • Remove same-priority conflict names from the rebuilt local device map before assigning it to the cache.
  • Assert that a same-priority duplicate reports a refresh conflict and cannot be resolved through get_device.

Downstream motivation

OpenShell currently has a temporary workaround for this cache behavior in NVIDIA/OpenShell#2775. Once it updates to a release containing this fix, that workaround can be removed.

Testing

  • cargo test cache::tests
  • cargo fmt --check (the pinned Rust 1.94.0 toolchain lacks the rustfmt component in this environment)

Checklist

  • Follows Conventional Commits
  • Commit is signed off (DCO)

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Copilot AI lite review requested due to automatic review settings August 19, 2026 07:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a cache correctness bug in Cache::refresh() where same-priority conflicts were reported as errors but could still remain resolvable after the refreshed device map replaced self.devices. The change aligns the Rust cache behavior with the Go CDI cache by ensuring conflicting fully-qualified device names are removed from the newly built local device map before it is installed into the cache.

Changes:

  • Remove same-priority conflicting device names from the rebuilt devices map (instead of mutating the soon-to-be-overwritten self.devices).
  • Extend the conflict test to assert that get_device() cannot resolve a device name involved in a same-priority conflict.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zvonkok zvonkok added the ok-to-test Ok to run CI/CD label Aug 19, 2026
@zvonkok
zvonkok merged commit d4efa35 into cncf-tags:main Aug 19, 2026
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Ok to run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants