This is an automated email from the ASF dual-hosted git repository.

mgreber pushed a commit to branch branch-1.18.x
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/branch-1.18.x by this push:
     new b1f136423 KUDU-3631 Fix Master shutdown
b1f136423 is described below

commit b1f136423cc1415e4376fa497c523355253b164b
Author: Ádám Bakai <[email protected]>
AuthorDate: Wed Dec 18 12:48:12 2024 +0100

    KUDU-3631 Fix Master shutdown
    
    TSAN gave a warning because CountDownLatch::WaitUntil() and
    CountDownLatch::~CountDownLatch() were running at the same time. The
    solution is to set it to zero and wait until the deleter thread relying
    on the latch is also joined,
    
    Change-Id: Iebcdd22dca27c4b0dcbeecf7d87e88c923eedaa8
    Reviewed-on: http://gerrit.cloudera.org:8080/22158
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: Alexey Serbin <[email protected]>
    (cherry picked from commit d3f6170fcea3a4044e9f9d89d6bb073d0a66eb66)
    Reviewed-on: http://gerrit.cloudera.org:8080/22307
    Tested-by: Kudu Jenkins
    Reviewed-by: Marton Greber <[email protected]>
---
 src/kudu/master/master.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/kudu/master/master.cc b/src/kudu/master/master.cc
index 484094704..9f7fa7dc9 100644
--- a/src/kudu/master/master.cc
+++ b/src/kudu/master/master.cc
@@ -547,6 +547,12 @@ void Master::ShutdownImpl() {
     
fs_manager_->UnsetErrorNotificationCb(ErrorHandlerType::KUDU_2233_CORRUPTION);
     fs_manager_->UnsetErrorNotificationCb(ErrorHandlerType::CFILE_CORRUPTION);
     fs_manager_->UnsetErrorNotificationCb(ErrorHandlerType::DISK_ERROR);
+    if (expired_reserved_tables_deleter_thread_) {
+      // Set the countdown latch to zero to trigger 
expired_reserved_tables_deleter_thread_
+      // to stop. Then wait for the thread to actually stop.
+      stop_background_threads_latch_.Reset(0);
+      expired_reserved_tables_deleter_thread_->Join();
+    }
 
     // 3. Shut down generic subsystems.
     KuduServer::Shutdown();

Reply via email to