[pve-devel] [PATCH container v2] Fix #576: Cancelling move disk does not leave useless files anymore
Dominic Jäger
d.jaeger at proxmox.com
Wed Jun 12 11:10:06 CEST 2019
I'll make more detailed commit messages from now on.
On 6/12/19 7:59 AM, Thomas Lamprecht wrote:
> On 6/6/19 11:52 AM, Dominic Jäger wrote:
>> When cancelling the move disk operation for containers the partly
>> finished destination and thus useless files now get removed.
> I really do not understand the commit message, could you please
> describe here how/why that happens now?
When Move Disk is called for a container rsync starts copying it to a
new destination. This initial rsync process gets killed when the Stop
button gets pressed. At this moment the destination file is not fully
copied and useless as a consequence. Our code already tries to remove
it. However, rsync has forked and those forks are still accessing the
destination file for some time. Thus, the attempt to remove it fails.
With the patch we wait for other processes (which are only rsync's
children normally) to release the destination files. This took less than
a second when I tried it. Afterwards, the existing remove procedure is
carried out.
More information about the pve-devel
mailing list