>>And what happens if we get other errors? Currently It's retrying until $i > ~0
but we could add a die directly if $err !~ image still has watchers ----- Mail original ----- De: "Dietmar Maurer" <[email protected]> À: "Alexandre Derumier" <[email protected]>, [email protected] Envoyé: Jeudi 6 Novembre 2014 12:23:10 Objet: RE: [pve-devel] [PATCH] rbd : free_image : retry if rbd has watchers > $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; > + } _______________________________________________ pve-devel mailing list [email protected] http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
