_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
# 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'])