[Libguestfs] [PATCH 02/18] rhv-upload: Check status more frequently

Daniel Erez derez at redhat.com
Mon Nov 18 12:30:33 UTC 2019


On Mon, Nov 18, 2019 at 1:51 AM Nir Soffer <nsoffer at redhat.com> wrote:

> Daniel, please review this one.
>
> On Mon, Nov 18, 2019 at 1:04 AM Nir Soffer <nirsof at gmail.com> wrote:
> >
> > Checking status more frequently save a couple of seconds. Here is
> > an example flow tested with oVirt upload_disk.py example:
> >
> > With 5 seconds wait:
> >
> > Created disk in 11.085111 seconds
> > Created transfer in 1.857502 seconds
> >
> > With 1 second wait:
> >
> > Created disk in 4.991227 seconds
> > Created transfer in 1.961243 seconds
> > ---
> >  v2v/rhv-upload-plugin.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
> > index fdd2012f5..472d483f2 100644
> > --- a/v2v/rhv-upload-plugin.py
> > +++ b/v2v/rhv-upload-plugin.py
> > @@ -161,7 +161,7 @@ def open(readonly):
> >
> >      endt = time.time() + timeout
> >      while True:
> > -        time.sleep(5)
> > +        time.sleep(1)
> >          disk = disk_service.get()
> >          if disk.status == types.DiskStatus.OK:
> >              break
> > @@ -197,7 +197,7 @@ def open(readonly):
> >              transfer_service.cancel()
> >              raise RuntimeError("timed out waiting for transfer status "
> >                                 "!= INITIALIZING")
> > -        time.sleep(5)
> > +        time.sleep(1)
> >
> >      # Now we have permission to start the transfer.
> >      if params['rhv_direct']:
> > --
> > 2.21.0
> >
>
>
looks good, ack.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20191118/a542c8e1/attachment.htm>


More information about the Libguestfs mailing list