Change in vdsm[master]: migration: Add retry logic for incoming limit

fromani at redhat.com fromani at redhat.com
Wed Jan 27 11:22:36 UTC 2016


Francesco Romani has posted comments on this change.

Change subject: migration: Add retry logic for incoming limit
......................................................................


Patch Set 2:

(2 comments)

https://gerrit.ovirt.org/#/c/46971/2/lib/vdsm/response.py
File lib/vdsm/response.py:

Line 69:         if err:
       :             return code == errCode[err]
       :         else:
I don't like this. Can't you just do

  expected_error = response.error('migrationLimit')
  res = some_call()
  if res == expected_error:
     # handle it

?


https://gerrit.ovirt.org/#/c/46971/2/vdsm/virt/migration.py
File vdsm/virt/migration.py:

Line 346:                     # so don't try again
Line 347:                     if self._migrationCanceledEvt:
Line 348:                         break
Line 349: 
Line 350:                     SourceThread._ongoingMigrations.release()
I understand why you do this but I really don't like it this way. Looks fragile and makes the code harder to follow.
Let's think about a cleaner way, possibly involving (the least amount of) refactoring.
Line 351:                     # the destination is busy with incoming migrations
Line 352:                     # release semaphore and give other outgoing migrations
Line 353:                     # a chance
Line 354:                     time.sleep(5)


-- 
To view, visit https://gerrit.ovirt.org/46971
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icabe79dfccb61ce43489a9a242a5390e73979649
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list