]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Client: make sure the Finisher's mutex lock not held during it being distructed 33915/head
authorXiubo Li <xiubli@redhat.com>
Tue, 31 Mar 2020 09:09:45 +0000 (05:09 -0400)
committerXiubo Li <xiubli@redhat.com>
Wed, 1 Apr 2020 00:43:10 +0000 (20:43 -0400)
commitfbff4ee153f17da51c3b6675eb0616f2b2062f5e
treef521120eacd97b2e662ae2fbbbf93d8073268229
parent867bc6064482174c524a858a24f704450201535e
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>
src/client/Client.cc
src/client/Client.h