oxidecomputer / oxidecomputer/dropshot

Sharing an `ApiDescription` with multiple server instances

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

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
104
Avg merge
1d 19h
Merged PRs (30d)
22

Description

If one wants to run the same set of endpoints in multiple servers (e.g., in the example added in #543), one awkward corner of dropshot's API is that ApiDescription is not cloneable, so it must be recreated from scratch for each server instance. A couple possibilities, neither of which is trivial to implement:

  1. We could implement Clone for ApiDescription, but it can't be derived (and many of the types that would also need to implement Clone cannot either) because doing so would require the server context to be cloneable, but that isn't actually necessary to clone the description.
  2. We could find a way to sprinkle in some Arcs to allow sharing an ApiDescription between multiple servers. It's not immediately obvious how to do this due to ApiDescription::into_router() consuming the ApiDescription.

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 by reading dropshot/src/api_description.rs, especially ApiDescription::into_router() and the surrounding ownership of server context. Trace how an ApiDescription becomes a router and determine what design would let multiple server instances share the endpoint description without recreating it; done means the same description can support multiple servers while preserving the existing context semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
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.