Hello Nir Soffer, Dan Kenigsberg,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs ......................................................................
clientIF: Use a weakref.proxy when registering contEIOVMs
Our storage Event class is taking a weakref on the callback function that is passed into Event.register. Unfortunately weakrefs on bound methods are dead on arrival. See this [1] discussion for more information. Use the same approach as StoragePool._upgradeCallback and use a weakref.proxy to build the callback function.
[1] http://code.activestate.com/recipes/81253/
Change-Id: Ib06967b26fc9ace41e5f8305a8fadafbbb0fc4e4 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1157421 Signed-off-by: Adam Litke alitke@redhat.com Reviewed-on: http://gerrit.ovirt.org/35436 Reviewed-by: Nir Soffer nsoffer@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/clientIF.py 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/35808/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py index bb42ee4..3678f9d 100644 --- a/vdsm/clientIF.py +++ b/vdsm/clientIF.py @@ -23,6 +23,8 @@ import time import threading import uuid +from functools import partial +from weakref import proxy
import alignmentScan from vdsm.config import config @@ -77,7 +79,8 @@ self._shutdownSemaphore = threading.Semaphore() self.irs = irs if self.irs: - self.irs.registerDomainStateChangeCallback(self.contEIOVms) + self._contEIOVmsCB = partial(clientIF.contEIOVms, proxy(self)) + self.irs.registerDomainStateChangeCallback(self._contEIOVmsCB) self.log = log self._recovery = True self.channelListener = Listener(self.log)
Adam Litke has posted comments on this change.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs ......................................................................
Patch Set 1: Verified+1
Dan Kenigsberg has posted comments on this change.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs ......................................................................
Patch Set 1: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs ......................................................................
Patch Set 1: Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs ......................................................................
clientIF: Use a weakref.proxy when registering contEIOVMs
Our storage Event class is taking a weakref on the callback function that is passed into Event.register. Unfortunately weakrefs on bound methods are dead on arrival. See this [1] discussion for more information. Use the same approach as StoragePool._upgradeCallback and use a weakref.proxy to build the callback function.
[1] http://code.activestate.com/recipes/81253/
Change-Id: Ib06967b26fc9ace41e5f8305a8fadafbbb0fc4e4 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1157421 Signed-off-by: Adam Litke alitke@redhat.com Reviewed-on: http://gerrit.ovirt.org/35436 Reviewed-by: Nir Soffer nsoffer@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/35808 --- M vdsm/clientIF.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Adam Litke: Verified Dan Kenigsberg: Looks good to me, approved
oVirt Jenkins CI Server has posted comments on this change.
Change subject: clientIF: Use a weakref.proxy when registering contEIOVMs ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-fc19-x86_64_merged/129/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-fc20-x86_64_merged/129/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-el7-x86_64_merged/129/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_3.5_create-rpms-el6-x86_64_merged/132/ : SUCCESS
vdsm-patches@lists.fedorahosted.org