]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix incorrect invocation of _add_to_threadpool
authorIan Denhardt <ian@zenhack.net>
Thu, 26 Mar 2015 01:47:47 +0000 (21:47 -0400)
committerIan Denhardt <ian@zenhack.net>
Thu, 26 Mar 2015 17:32:54 +0000 (13:32 -0400)
_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

cinder/volume/manager.py

index 3d605ac038a3a6067016178a78d72b86708e811a..fd241b720b93157488333de8ee4f1d516717d624 100644 (file)
@@ -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_volumectxt,
+                                            volume['id'])
                 else:
                     # By default, delete volumes sequentially
                     self.delete_volume(ctxt, volume['id'])