Resilient File Operations over Sleep and Hibernation.
Affected Version
- Version: 46.rc
- Distribution: Fedora 46 Silverblue
File Operations Should be Resilient to Common Interruptions
In Gnome, if you start a long file-copy or move, often your laptop will go to sleep or go into hibernation.
The resulting experiences is less-than-satisfying:
Incomplete File Transfers
- The file copy is not intelligent. It often uses a huge cache, resulting is the appearance of a fast copy, but overtime it gets slower.
- Worse, when the computer goes to sleep, (after the file copy has pseudo-completed, the power to the external device may be lost while still synchronizing the mount.
- Even worse: if the computer goes to sleep while a copy command is in process, the large cache will mean the the displayed copy-position is not accurate for the actual storage device!
Skipping Files
- When a device is no-longer present, Files will report that some files failed to copy, (notwithstanding the cache problems mentioned above), there is no option, carefully remounting and skipping the files is possible, but it is difficult to get right.
Use Cases
Everyone who doesn't use a server.
Available Workarounds
Use a stable transfer program such as rsync.
Suggested Enhancements
Preform comprehensive pre-flight checks and make file copies and moves resilient and intelligent:
Such as:
- Check if "ref-link" is available for this copy. - If so, attempt the copy with "--reflink=always", and check result.
- Mount external devices with minimal cache, and use a presumable, using something like "rsync --whole-file".
- If the source or destination device are lost, pause the operation, notifiy the user to either cancel, or reconnect the devices, and resume the transfer after re-preforming the pre-flight check (the files may have changed), notifying the user of any discrepancy.
In general, we should check for conflicts, and clear the intention of the user before starting operations, we should have a log that describes what the intention is, and what steps have been taken to fulfill it.
We should be clear and explicit about what happens to other peoples data.