oxidecomputer / oxidecomputer/crucible

Panic in transfer's unwrap of downstairs_buffer

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

Nobody has claimed this yet.

Dominant language
Rust
Stars
260
Forks
34
Avg merge
2d 1h
Merged PRs (30d)
8

Description

In async fn transfer(..), this unwrap can panic:

                let responses = self.downstairs_buffer.remove(ds_id).unwrap();

If (I believe) we have three downstairs that have returned error (not skipped) none of them added
to the downstairs_buffer, and we get the unwrap() panic.

Update the code to better check for errors and if so, don't panic.

If at least one of the reads did succeed, and we should have a buffer, then we probably should
panic as that would mean something in crucible has lost the buffer and returning success to
the guest without giving them that buffer would be data corruption and we can't have that.

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 async fn transfer(..) at the downstairs_buffer.remove(ds_id).unwrap() call and trace how downstairs read errors and successful reads reach it. The change is done when error-only reads avoid the panic, while a missing buffer after a successful read still preserves the stated data-integrity invariant.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.