[pve-devel] [PATCH] rbd : free_image : retry if rbd has watchers
Dietmar Maurer
dietmar at proxmox.com
Thu Nov 6 12:23:10 CET 2014
> $cmd = &$rbd_cmd($scfg, $storeid, 'rm', $name);
> - run_rbd_command($cmd, errmsg => "rbd rm '$volname' error");
> +
> + my $i = 0;
> + while(1){
> + $i++;
> + eval {
> + run_rbd_command($cmd, errmsg => "rbd rm '$volname' error");
> + };
> + my $err = $@;
> +
> + sleep 1 if ($err && $err =~ m/image still has watchers/);
And what happens if we get other errors?
> +
> + die "image still has watchers" if $i > 10;
> + last if !$err;
> + }
More information about the pve-devel
mailing list