]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
Client: make sure the Finisher's mutex lock not held during it being distructed 35000/head
authorXiubo Li <xiubli@redhat.com>
Tue, 31 Mar 2020 09:09:45 +0000 (05:09 -0400)
committerNathan Cutler <ncutler@suse.com>
Mon, 11 May 2020 16:16:39 +0000 (18:16 +0200)
commit8a6573638073b5f41475f28eb5c96a5fd3c113e2
treee48969f017ff3cce0475b04e412d8cd7a6564734
parent7f93f855492054113563e42d3e3747ca3eb1455a
Client: make sure the Finisher's mutex lock not held during it being distructed

The objecter_finisher is already started in Client::Client(), but
in the failure path when initializing and starting the Client object,
we may not get a chance to call the Client::shutdown() to stop the
Finisher thread, which maybe still holding the mutex lock in it. Then
when destrucing the Finisher object the pthread_mutex_destroy() will
fail.

This fix will delay the objecter_finisher thread to start in ::init()
until we're ready to call Client::shutdown on any errors instead.

Fixes: https://tracker.ceph.com/issues/44389
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit fbff4ee153f17da51c3b6675eb0616f2b2062f5e)

Conflicts:
src/client/Client.cc
- nautilus uses client_lock.Lock()/client_lock.Unlock() instead of
  std::lock_guard in a code block
src/client/Client.cc
src/client/Client.h