oxidecomputer / oxidecomputer/omicron

sled-agent: Move IPCC calls off of tokio worker threads?

Open
#9,721 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In oxidecomputer/stlouis#909, we encountered an OS bug that caused IPCC ioctls to hang indefinitely. In sled-agent, we call these directly from tokio worker threads, which led to several worker threads getting stuck, and eventually hitting oxidecomputer/omicron#9619 where the entire runtime blocked (even though some worker threads were still parked / idle). oxidecomputer/omicron#9619 proposes we implement the general workaround where we periodically spawn a new task into the runtime, which will unstick a runtime stuck because the one thread responsible for I/O is blocked polling the future that caused it to wake up. However, it seems unlikely this would have helped much in the oxidecomputer/stlouis#909 case - we probably would have only delayed sled-agent hanging, because eventually we would have issued enough IPCC calls to hang all the worker threads.

I'm inclined to say we should treat IPCC calls as "blocking I/O" calls - that seems pretty accurate, since we're doing I/O over a uart to the SP (and/or RoT, depending on the IPCC command) - and put them in spawn_blocking. But I'm not sure what that would do in a case like oxidecomputer/stlouis#909 - if every IPCC call hangs, would we eventually exhaust the spawn_blocking pool? Presumably sled-agent would remain generally responsive (except in paths that depended on those IPCC calls?), but what would happen in the limit?

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 by tracing sled-agent’s IPCC call sites and how those calls run on Tokio worker threads. Read the stlouis#909 and omicron#9619 incidents for context, then evaluate direct calls versus spawn_blocking, including behavior when IPCC calls hang and the blocking pool is exhausted. Done requires a decided and validated handling strategy.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.