install/verify: no rollback when installation fails part-way #19
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-module-manager#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
After signature and hashes are verified,
verify.verify()copies the files oneby one into
modules_dir/<module>/. If amkdirorcpfails half way, themodule stays partially installed. Files of an older version are overwritten one
by one as well, so a failed upgrade leaves a mix of old and new files.
In
install/init.luathe old module directory is removed before the package isdownloaded and verified (
fs.remove_dir_recursive(dir)runs beforedownload()and
helpers.verify.verify()). If the download or the verification fails afterthat, the installed module is gone.
Scope
stage the new files in a directory next to the target (same filesystem),
then replace the old directory by rename
(it is a follow-up error next to the primary result)
Acceptance criteria
Done in v2.0.0: the package is verified first, then activate.lua copies the files next to the target and swaps the directories by renaming (..new and ..old). A failure leaves the previous version in place, and the leftovers of an aborted run are cleaned up or rolled back at the next run. The old directory is no longer removed before the download. Tests in test_activate.lua.