Do `Lifecycle::{pause,resume}` need to be fallbile?

Aperta
#1,251 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start by reading the Lifecycle trait and its implementations, especially PciVirtioViona and PciVirtioVsock, where fallible calls are mentioned. Audit those calls and determine which can fail and how their errors should be handled; done means the implementations have a consistent, decided approach to reporting or propagating failures.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

We're putting together a prototype of Propolis that transfers OPTE's dynamic state like flow-tables during a migration. I naively called out to the OPTE methods for pausing and resuming inside the impl Lifecycle for PciVirtioViona, but realized that these methods are infallible, while the OPTE methods return an error. It's not clear what to do with that error. We could ignore it, panic, or return it (changing the trait method).

There are actually other places where we currently ignore a fallible call inside Lifecycle methods, e.g., for PciVirtioViona and PciVirtioVsock. That naively seems like the worst option, since we continue operating in an indeterminate state. Panicking seems better, but also forecloses on the opportunity to tell upstack software like Omicron what went wrong. Returning an error seems like a good choice too, but has drawbacks. It's not really clear that any of the failures even can happen in practice, in which case the error is more misleading than helpful. It's also not clear what to do when we hit one, since it might not really be possible to recover. But I do still think at least reporting the error, even if we then panic, is an improvement.

In any case, we should probably audit the Lifecycle implementations to see which are actually fallible and decide what to do with those errors.

Lingua principale
Rust
Stelle
326
Fork
49
Merge medio
1g 13h
PR unite (30g)
10

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/propolis

Tutte le issue di oxidecomputer/propolis

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.