Project

General

Profile

Actions

Bug #4068

closed

libcephfs: if client->init() fails, shutdown() erroneously calls client->shutdown(), resulting in an assert being triggered

Added by Anonymous about 11 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.

Actions #1

Updated by Anonymous about 11 years ago

title should be "erroneously calls" and not the inverse.

Actions #2

Updated by Anonymous about 11 years ago

branch wip-4068-buck has one possible fix for this issue (but maybe not the cleanest option).

Actions #3

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
Actions #4

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?

Actions #5

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.

Actions #6

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.

Actions #7

Updated by Greg Farnum almost 7 years ago

  • Project changed from Ceph to CephFS
  • Category deleted (24)
Actions

Also available in: Atom PDF