oxidecomputer / oxidecomputer/maghemite

ddm: `enable_stats` smashes all errors into 500s

Open
#303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ddm
Dominant language
Rust
Stars
94
Forks
6
Avg merge
1d 8h
Merged PRs (30d)
12

Description

This code smashes all errors to the enable_stats endpoint into 500s.

https://github.com/oxidecomputer/maghemite/blob/ef0edbbf3cf7b3f832e96901dd97282eb9b18cc7/ddm/src/admin.rs#L382-L386

It would be helpful to be more specific here, in particular if the underlay configuration has not gotten far enough along yet to enable stats, we'll probably want to return something more like a 503.

Contributor guide

No contributing guide indexed for this repository

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 at ddm/src/admin.rs around lines 382-386, where errors from the enable_stats endpoint are converted into HTTP 500 responses. Trace the errors that can occur when underlay configuration is not ready, and make the endpoint return more specific status codes, including 503 for that unavailable state.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.