Nir Soffer
2019-Nov-17 23:53 UTC
Re: [Libguestfs] [PATCH 10/18] rhv-upload: Try to remove disk on timeout
On Mon, Nov 18, 2019 at 1:05 AM Nir Soffer <nirsof@gmail.com> wrote:> > If waiting for the disk to become OK times out, try to remove it. This > is likely to fail.Daniel, do you think this can succeed?> --- > v2v/rhv-upload-plugin.py | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py > index 9b433bd7e..e79e7ddf7 100644 > --- a/v2v/rhv-upload-plugin.py > +++ b/v2v/rhv-upload-plugin.py > @@ -575,6 +575,11 @@ def create_disk(connection): > if disk.status == types.DiskStatus.OK: > break > if time.time() > endt: > - raise RuntimeError("timed out waiting for disk to become unlocked") > + try: > + disk_service.remove() > + except Exception as e: > + debug("error removing disk %s: %s" % (disk.id, e)) > + raise RuntimeError( > + "timed out waiting for disk %s to become unlocked" % disk.id) > > return disk > -- > 2.21.0 >
Daniel Erez
2019-Nov-18 12:37 UTC
Re: [Libguestfs] [PATCH 10/18] rhv-upload: Try to remove disk on timeout
On Mon, Nov 18, 2019 at 1:53 AM Nir Soffer <nsoffer@redhat.com> wrote:> On Mon, Nov 18, 2019 at 1:05 AM Nir Soffer <nirsof@gmail.com> wrote: > > > > If waiting for the disk to become OK times out, try to remove it. This > > is likely to fail. > > Daniel, do you think this can succeed? >seems redundant, as remove disk will surely fail when the disk is still locked.> > > --- > > v2v/rhv-upload-plugin.py | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py > > index 9b433bd7e..e79e7ddf7 100644 > > --- a/v2v/rhv-upload-plugin.py > > +++ b/v2v/rhv-upload-plugin.py > > @@ -575,6 +575,11 @@ def create_disk(connection): > > if disk.status == types.DiskStatus.OK: > > break > > if time.time() > endt: > > - raise RuntimeError("timed out waiting for disk to become > unlocked") > > + try: > > + disk_service.remove() > > + except Exception as e: > > + debug("error removing disk %s: %s" % (disk.id, e)) >the following couple of lines looks good, perhaps extract to another patch?> > + raise RuntimeError( > > + "timed out waiting for disk %s to become unlocked" % > disk.id) >> > > return disk > > -- > > 2.21.0 > > > >
Nir Soffer
2019-Nov-18 15:59 UTC
Re: [Libguestfs] [PATCH 10/18] rhv-upload: Try to remove disk on timeout
On Mon, Nov 18, 2019 at 2:38 PM Daniel Erez <derez@redhat.com> wrote:> > > > On Mon, Nov 18, 2019 at 1:53 AM Nir Soffer <nsoffer@redhat.com> wrote: >> >> On Mon, Nov 18, 2019 at 1:05 AM Nir Soffer <nirsof@gmail.com> wrote: >> > >> > If waiting for the disk to become OK times out, try to remove it. This >> > is likely to fail. >> >> Daniel, do you think this can succeed? > > > seems redundant, as remove disk will surely fail when the disk is still locked.Thanks, will remove it in v2.>> > --- >> > v2v/rhv-upload-plugin.py | 7 ++++++- >> > 1 file changed, 6 insertions(+), 1 deletion(-) >> > >> > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py >> > index 9b433bd7e..e79e7ddf7 100644 >> > --- a/v2v/rhv-upload-plugin.py >> > +++ b/v2v/rhv-upload-plugin.py >> > @@ -575,6 +575,11 @@ def create_disk(connection): >> > if disk.status == types.DiskStatus.OK: >> > break >> > if time.time() > endt: >> > - raise RuntimeError("timed out waiting for disk to become unlocked") >> > + try: >> > + disk_service.remove() >> > + except Exception as e: >> > + debug("error removing disk %s: %s" % (disk.id, e)) > > > the following couple of lines looks good, perhaps extract to another patch?Right, will keep this in v2.> >> >> > + raise RuntimeError( >> > + "timed out waiting for disk %s to become unlocked" % disk.id) > > >> > >> > return disk >> > -- >> > 2.21.0 >> > >>
Apparently Analagous Threads
- Re: [PATCH 10/18] rhv-upload: Try to remove disk on timeout
- [PATCH 10/18] rhv-upload: Try to remove disk on timeout
- Re: [PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
- Re: [PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
- [PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)