mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-11-22 08:13:59 +00:00
An installed package could not be updated: install refused it, and uninstalling and reinstalling it was neither atomic nor safe for running sessions, which read files from the package directory. A package is now staged, checked, verified, admitted and flushed. It is then renamed to an immutable revision named by its content digest, <store>/.revisions/<id>/<digest>, and activated by one rename of the link <store>/<id>. A failure or interruption at any point leaves the previously active revision active, and a failed first installation leaves nothing installed. The revision active before an update is kept, and weft-pack rollback makes it active again after checking it against the owner record. Other revisions are collected by later operations on the app, unless a session still runs from them. Leftovers of interrupted operations are collected too. weft-appd follows the store link only to one of the app's own revisions. It runs a session from the revision directory and holds a shared lock on it for the session's lifetime, so an update, rollback or uninstall never changes or removes the bytes of a running session. A package directory from before revisions is still read. An update replaces it in one exchange, and only while no session runs from it. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||