Skip to content

Commit 77f0ef9

Browse files
committed
fix(cinder-understack): clean up a library's looping call tasks
Take each task that a library's looping call has in it and call stop and then drain the list. This should allow us to remove a running library instance.
1 parent 2f0b270 commit 77f0ef9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/cinder-understack/cinder_understack/dynamic_netapp_driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ def _remove_svm_lib(self, svm_name: str, svm_lib: NetAppMinimalLibrary):
237237
"""Remove resources for a given SVM library."""
238238
# TODO: Need to free up resources here.
239239
LOG.info("Removing resources for SVM library %s", svm_name)
240-
# Stop any looping calls if they exist
241-
if hasattr(svm_lib, "loopingcalls"):
242-
LOG.info("Stopping looping call for SVM library %s", svm_name)
240+
for task in svm_lib.loopingcalls.tasks:
241+
task.looping_call.stop()
242+
svm_lib.loopingcalls.tasks = []
243243

244244
def _refresh_svm_libraries(self):
245245
return self._actual_refresh_svm_libraries(context.get_admin_context())

0 commit comments

Comments
 (0)