From: Alexey Sheplyakov Date: Tue, 7 Feb 2017 12:47:45 +0000 (+0400) Subject: ceph-osd: --flush-journal: sporadic segfaults on exit X-Git-Tag: v11.2.1~171^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33d9a50dec40346511f8480061dadab2a30174cc;p=ceph.git ceph-osd: --flush-journal: sporadic segfaults on exit FileStore holds a number of recources like op thread pool and work queue, key/value DB threads, etc. These should be properly stopped (released) before exiting to avoid segfaults on exit. Note: more code paths (mkfs, dump_journal, etc) need similar fixes, these will be submitted as separate patches. Fixes: http://tracker.ceph.com/issues/18820 Signed-off-by: Alexey Sheplyakov (cherry picked from commit 00184814c156f6194a6ba4b696073ca1c18a3f8f) --- diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index db1e4a9a143..6115422a7e2 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -354,13 +354,15 @@ int main(int argc, const char **argv) derr << TEXT_RED << " ** ERROR: error flushing journal " << g_conf->osd_journal << " for object store " << g_conf->osd_data << ": " << cpp_strerror(-err) << TEXT_NORMAL << dendl; - exit(1); + goto flushjournal_out; } store->umount(); derr << "flushed journal " << g_conf->osd_journal << " for object store " << g_conf->osd_data << dendl; - exit(0); +flushjournal_out: + delete store; + exit(err < 0 ? 1 : 0); } if (dump_journal) { common_init_finish(g_ceph_context);