Library: every Home folder writer takes the Library lock

Aperta
#488 1 commento 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
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend, database

Direzione di ricerca

Start by tracing the Library lock and the writer paths named in the issue: the localhost provider and IPFS writes, activation and rollback encryption, and first-read encryption. Then trace the listed handlers and confirm whether update activation stops Runtime before migration. Done means tests show each writer waits for a Library move without losing acknowledged saves, Mac and Linux checks pass with two clients, and independent review passes.

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

Descrizione

Goal

Every writer that changes files in a Home folder takes the same Library lock as Library, so a Library move, copy or save never overlaps another writer's save.

Where #480 stops

#480 puts these writers under one lock, shared by Runtime and the object-provider process: Library changes, uploads, Documents, viewer storage saves, publish records, and capsule writes to protected Home folders. Library also refuses to change app folders (.AppData, BrowserProfiles) and hides them at the top of the Library.

The writers below still change files in Home folders that Library can change, without that lock:

  • B. localhost provider. Write, append, delete and new-folder requests reach the localhost-provider capsule from the capsule resource bridge (writes when the Home folder is not protected; delete and new folder always) and from the /api/provider/localhost proxy. The IPFS cat_to_path and download_directory operations can also write under Users/.
  • C. Encryption at Profile setup and recovery. migrate_principal_root_plaintext_objects_under_activation and the journal rollback restore_journal_plaintext_object replace Library files while Home runs, under the object mutex and lifecycle lock only.
  • D. First-read encryption of older plaintext Library files. protect_legacy_plaintext_principal_root_object, reached from Library reads in both processes, reads, encrypts and writes back without the lock. This overlaps #450.

Also confirm: the update activation path (acquire_principal_root_update_lock) stops Runtime before it migrates Home folders; and trace the handlers the #480 inventory did not reach (inbox_action, System AI provider, approval lens and community, capsule_interface_invoke, Home launch, the home-cli renderer child).

Proposed change (about 100 lines plus tests)

  • B: Runtime takes the Library lock around forwarding write, append, delete and new-folder requests for Users/ paths, protected or not; refuse or lock IPFS destinations under Users/.
  • C: the activation guards take the Library lock before the object mutex.
  • D: first-read encryption takes the Library lock when its caller does not already hold it (a per-thread marker keeps locked Library operations from waiting on themselves).

Done when

  • A test for each writer shows that it waits for a Library move and that no acknowledged save is lost (fail-before first).
  • An installed Mac and Linux check with two clients passes.
  • Independent review passes.

Related: #480, #450.

Lingua principale
Rust
Stelle
6
Fork
2
Merge medio
1g 3h
PR unite (30g)
42

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 elastos/elastos-runtime

Tutte le issue di elastos/elastos-runtime

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.