]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: flush task finisher queue on unregistering watcher
authorMykola Golub <mgolub@suse.com>
Fri, 4 Dec 2020 10:50:33 +0000 (10:50 +0000)
committerMykola Golub <mgolub@suse.com>
Fri, 4 Dec 2020 10:50:33 +0000 (10:50 +0000)
To make sure all inflight requests like scheduled
cancel_async_requests are complete on shutdown.

Signed-off-by: Mykola Golub <mgolub@suse.com>
src/librbd/ImageWatcher.cc

index 15155b7454916b62a15db2608c9f5ff6d08adb23..b2f9d610d7d2e1c7d78f577ca00e5622782b5c86 100644 (file)
@@ -88,6 +88,9 @@ void ImageWatcher<I>::unregister_watch(Context *on_finish) {
 
   cancel_async_requests();
 
+  // flush the task finisher queue before completing
+  on_finish = create_async_context_callback(m_task_finisher, on_finish);
+
   on_finish = new LambdaContext([this, on_finish](int r) {
     cancel_quiesce_requests();
     m_task_finisher->cancel_all();