Bug #4068
closedlibcephfs: if client->init() fails, shutdown() erroneously calls client->shutdown(), resulting in an assert being triggered
0%
Description
In src/libcephfs.cc mount() function:
if the client->init() call fails, shutdown() gets called. Assuming that the client variable is a valid object, shutdown calls client->shutdown().
client->shutdown() should not get called if client->init() failed because client->shutdown() asserts that init() succeeded. Consequently, we need a way to tell if client->init() succeeded independent of the object being valid.
The use case that uncovered this issue was attempting to issue a Hadoop command that uses libcephfs when the keyring was not accessible by the client (due to permissions issue on the file). At present, client->shutdown() being erroneously called results in a coredump that looks like this:
./osdc/ObjectCacher.h: In function 'void ObjectCacher::stop()' thread 7fe69b022700 time 2013-02-09 18:22:21.675116
./osdc/ObjectCacher.h: 496: FAILED assert(flusher_thread.is_started())
ceph version 0.56-698-g38dd59b (38dd59ba7cebe1941b864646246f98c75bb395c5)
1: (Client::shutdown()+0x392) [0x7fe689fa8f42]
2: (ceph_mount()+0x12b) [0x7fe689fa715b]
3: (Java_com_ceph_fs_CephMount_native_1ceph_1mount()+0xb7) [0x7fe68ac5a1e7]
4: [0x7fe690bfbd68]
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
terminate called after throwing an instance of 'ceph::FailedAssertion'
Aborted (core dumped)
Ideally this scenario would log something reasonable and exit cleanly.
Updated by Anonymous about 11 years ago
title should be "erroneously calls" and not the inverse.
Updated by Anonymous about 11 years ago
branch wip-4068-buck has one possible fix for this issue (but maybe not the cleanest option).
Updated by Ian Colle about 11 years ago
- Subject changed from libcephfs: if client->init() fails, shutdown() calls erroneously client->shutdown(), resulting in an assert being triggered to libcephfs: if client->init() fails, shutdown() erroneously calls client->shutdown(), resulting in an assert being triggered
Updated by Ian Colle about 11 years ago
- Status changed from New to Fix Under Review
- Assignee set to Josh Durgin
Josh - can you please review Joe's wip branch?
Updated by Ian Colle about 11 years ago
- Status changed from Fix Under Review to 7
- Assignee changed from Josh Durgin to Anonymous
Reviewed by Sage and Slang.
Updated by Anonymous about 11 years ago
- Status changed from 7 to Closed
Commit 133295ed001a950e3296f4e88a916ab2405be0cc resolves this issue. The failure case no longer throws an assert but instead exits gracefully.
Updated by Greg Farnum almost 7 years ago
- Project changed from Ceph to CephFS
- Category deleted (
24)