From: Ian Denhardt Date: Thu, 26 Mar 2015 01:47:47 +0000 (-0400) Subject: Fix incorrect invocation of _add_to_threadpool X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=748ddf3ec1caf1ad78cf58f3099618a62cb8eb56;p=openstack-build%2Fcinder-build.git Fix incorrect invocation of _add_to_threadpool _add_to_threadpool expects to be passed the function and which is to be run in an alternate thread, and the function's arguments. Instead, the function (self.delete_volume) was being invoked directly, and it's result passed to _add_to_threadpool. This results in a TypeError being raised (the result is a bool, which is not callable), but more importantly, it defeats the purpose of the statement - to offload the invocation of delete_volume to another thread. Change-Id: I524156cbffe0f6f5a2da902c6a62417d1ec425b9 Closes-Bug: #1436624 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 3d605ac03..fd241b720 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -361,8 +361,8 @@ class VolumeManager(manager.SchedulerDependentManager): # Offload all the pending volume delete operations to the # threadpool to prevent the main volume service thread # from being blocked. - self._add_to_threadpool(self.delete_volume(ctxt, - volume['id'])) + self._add_to_threadpool(self.delete_volume, ctxt, + volume['id']) else: # By default, delete volumes sequentially self.delete_volume(ctxt, volume['id'])