Change in vdsm[ovirt-3.3]: threadPool: Do not keep reference to tasks
Yaniv Bronhaim has submitted this change and it was merged. Change subject: threadPool: Do not keep reference to tasks .. threadPool: Do not keep reference to tasks Worker thread was taking a task from the threadpool queue, run it, and then hold it until the next task is run. This causes the task and all objects referenced from it to keep living until the next task is run by this thread. This patch ensure that worker thread does not keep referece to tasks after they were run. Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Relates-To: https://bugzilla.redhat.com/1032925 Signed-off-by: Nir Soffer nsof...@redhat.com Reviewed-on: http://gerrit.ovirt.org/22136 Reviewed-by: Ayal Baron aba...@redhat.com Reviewed-by: Allon Mureinik amure...@redhat.com Reviewed-on: http://gerrit.ovirt.org/22208 Reviewed-by: Yaniv Bronhaim ybron...@redhat.com Tested-by: Yaniv Bronhaim ybron...@redhat.com --- M vdsm/storage/threadPool.py 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Yaniv Bronhaim: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/22208 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.3 Gerrit-Owner: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Allon Mureinik amure...@redhat.com Gerrit-Reviewer: Ayal Baron aba...@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com Gerrit-Reviewer: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.3]: threadPool: Do not keep reference to tasks
Yaniv Bronhaim has posted comments on this change. Change subject: threadPool: Do not keep reference to tasks .. Patch Set 2: Verified+1 Code-Review+2 -- To view, visit http://gerrit.ovirt.org/22208 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.3 Gerrit-Owner: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Allon Mureinik amure...@redhat.com Gerrit-Reviewer: Ayal Baron aba...@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com Gerrit-Reviewer: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.3]: threadPool: Do not keep reference to tasks
Nir Soffer has posted comments on this change. Change subject: threadPool: Do not keep reference to tasks .. Patch Set 1: Verified+1 Verified by creating a vm and making few templates. -- To view, visit http://gerrit.ovirt.org/22208 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.3 Gerrit-Owner: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Allon Mureinik amure...@redhat.com Gerrit-Reviewer: Ayal Baron aba...@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com Gerrit-Reviewer: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.3]: threadPool: Do not keep reference to tasks
Hello Ayal Baron, Allon Mureinik, I'd like you to do a code review. Please visit http://gerrit.ovirt.org/22208 to review the following change. Change subject: threadPool: Do not keep reference to tasks .. threadPool: Do not keep reference to tasks Worker thread was taking a task from the threadpool queue, run it, and then hold it until the next task is run. This causes the task and all objects referenced from it to keep living until the next task is run by this thread. This patch ensure that worker thread does not keep referece to tasks after they were run. Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Relates-To: https://bugzilla.redhat.com/1032925 Signed-off-by: Nir Soffer nsof...@redhat.com Reviewed-on: http://gerrit.ovirt.org/22136 Reviewed-by: Ayal Baron aba...@redhat.com Reviewed-by: Allon Mureinik amure...@redhat.com --- M vdsm/storage/threadPool.py 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/22208/1 diff --git a/vdsm/storage/threadPool.py b/vdsm/storage/threadPool.py index b1f3142..a0e24a2 100644 --- a/vdsm/storage/threadPool.py +++ b/vdsm/storage/threadPool.py @@ -191,8 +191,8 @@ it, calling the callback if any. while not self.__isDying: +id, cmd, args, callback = self.__pool.getNextTask() try: -id, cmd, args, callback = self.__pool.getNextTask() if id is None: # should retry. pass elif self.__isDying: @@ -212,6 +212,11 @@ self.__pool.setRunningTask(False) except Exception: self.log.error(Task %s failed % repr(cmd), exc_info=True) +finally: +# Don't keep reference to objects taken from the pool. +# Otherwise this thread may keep those object alive until the +# next iteration. See BZ#1032925. +del id, cmd, args, callback def goAway(self): -- To view, visit http://gerrit.ovirt.org/22208 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.3 Gerrit-Owner: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Allon Mureinik amure...@redhat.com Gerrit-Reviewer: Ayal Baron aba...@redhat.com ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[ovirt-3.3]: threadPool: Do not keep reference to tasks
Yaniv Bronhaim has posted comments on this change. Change subject: threadPool: Do not keep reference to tasks .. Patch Set 1: Code-Review+2 verified? -- To view, visit http://gerrit.ovirt.org/22208 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6e024e0727e11a4c98f4e5ede20229d148fdc58 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.3 Gerrit-Owner: Nir Soffer nsof...@redhat.com Gerrit-Reviewer: Allon Mureinik amure...@redhat.com Gerrit-Reviewer: Ayal Baron aba...@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizr...@redhat.com Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches