From 748ddf3ec1caf1ad78cf58f3099618a62cb8eb56 Mon Sep 17 00:00:00 2001 From: Ian Denhardt Date: Wed, 25 Mar 2015 21:47:47 -0400 Subject: [PATCH] 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 --- cinder/volume/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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']) -- 2.45.2