oxidecomputer / oxidecomputer/propolis
Device and block backend lifecycle ops could return immediately if no async work is required
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 270
- Forks
- 42
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 6
Description
trait Lifecycle's paused function requires all its implementations to return a BoxFuture even if pausing requires no async work (e.g. because there's nothing to pause!). This function could instead return an enum with "Done" and "Pending" variants where only the latter contains a BoxFuture, allowing trivial impls to return immediately without a heap allocation.
#715 proposes to introduce a similar issue in the block::Backend trait (though masks it a bit with the use of async_trait). Several storage backends don't have any async callees in their start and stop methods and would benefit from a similar enum.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the trait Lifecycle paused function and the block::Backend trait's start and stop methods, then inspect their implementations across the storage backends. Compare the related proposal in issue #715. Done means lifecycle operations can return immediately when no asynchronous work is required while preserving pending behavior for operations that need it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100