Skip to content

feat(api): auto-transition rack between Ready and Error on component …#1768

Open
vinodchitraliNVIDIA wants to merge 1 commit into
NVIDIA:mainfrom
vinodchitraliNVIDIA:vc/rack_ready
Open

feat(api): auto-transition rack between Ready and Error on component …#1768
vinodchitraliNVIDIA wants to merge 1 commit into
NVIDIA:mainfrom
vinodchitraliNVIDIA:vc/rack_ready

Conversation

@vinodchitraliNVIDIA
Copy link
Copy Markdown
Contributor

@vinodchitraliNVIDIA vinodchitraliNVIDIA commented May 18, 2026

…health

The Ready handler now scans the rack's switches, power shelves, and machines for terminal failures and transitions the rack to Error with a descriptive cause when any are detected. Conversely, the Error handler promotes the rack back to Ready once every registered component reports Ready, allowing the rack state to reflect component health without manual intervention.

Description

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Related Issues (Optional)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@vinodchitraliNVIDIA vinodchitraliNVIDIA requested a review from a team as a code owner May 18, 2026 16:55
…health

The Ready handler now scans the rack's switches, power shelves, and machines
for terminal failures and transitions the rack to Error with a descriptive
cause when any are detected. Conversely, the Error handler promotes the rack
back to Ready once every registered component reports Ready, allowing the
rack state to reflect component health without manual intervention.
Copy link
Copy Markdown
Contributor

@kensimon kensimon left a comment

Choose a reason for hiding this comment

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

Minor nitpick otherwise LGTM

Comment on lines +76 to +77
let txn = ctx.services.db_pool.begin().await?;
return Ok(StateHandlerOutcome::transition(RackState::Ready).with_txn(txn));
Copy link
Copy Markdown
Contributor

@kensimon kensimon May 18, 2026

Choose a reason for hiding this comment

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

Nit: You don't need to start a transaction just to return it here, you can just skip calling with_txn:

Suggested change
let txn = ctx.services.db_pool.begin().await?;
return Ok(StateHandlerOutcome::transition(RackState::Ready).with_txn(txn));
return Ok(StateHandlerOutcome::transition(RackState::Ready));

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