oxidecomputer / oxidecomputer/hubris

SP serial console doesn't detach stale faux-mgs clients on an idle console

Open
#1,796 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:wave: good first issue developer-experience gimlet service processor
Dominant language
Rust
Stars
3.6k
Forks
239
Avg merge
1d 12h
Merged PRs (30d)
23

Description

faux-mgs allows us to attach to a gimlet's serial console via the SP. While faux-mgs is running, it ensures it's regularly sending serial console-related packets (either writes if there's data, or keeepalives if there isn't). On a clean exit, faux-mgs will detach itself from the console. But on a non-clean exit, the SP is responsible for eventually timing out the connection and allowing new attach requests. However, it looks like only check for staleness at https://github.com/oxidecomputer/hubris/blob/1d3f3d594cb55695fdf8c94e086b50498f05f121/task/control-plane-agent/src/mgs_gimlet.rs#L282-L303

This is inside the code path for "the SP has serial console data to send to faux-mgs". If the console is idle (e.g., someone left it sitting at a shell prompt), the SP will never send data, so will never realize the faux-mgs client has gone away. This isn't a major problem, because faux-mgs can forcibly detach any previous session, but it is annoying because it makes it look like there might be someone else on the console when there isn't. A pretty easy fix would be to also check for staleness in serial_console_attach().

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 task/control-plane-agent/src/mgs_gimlet.rs, reviewing the existing staleness check around lines 282-303 and the serial_console_attach() entry point. Confirm how an idle console differs from the data-send path, then ensure stale faux-mgs clients are recognized while the console is idle. Done means a new attach can proceed after a non-clean client exit without requiring a forced detach.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.