Project

General

Profile

Actions

Bug #2948

closed

rbd: fails to close image on error

Added by Josh Durgin over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
% Done:

0%

Source:
Q/A
Tags:
Backport:
argonaut
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

calling exit() doesn't run the Image destructor, which leads to the watch on the header sticking around. After that, you can't delete the image for 30 seconds until the watch times out.

The rbd calls exit(1) on almost any error, so this is easy to trigger.

Actions #1

Updated by Josh Durgin over 11 years ago

  • Status changed from 12 to 7
  • Assignee changed from Josh Durgin to Dan Mick
Actions #2

Updated by Dan Mick over 11 years ago

This affects operations that fail partway through. One example is:

rbd export <image> <existing-file>
export error: (17) File exists
rbd rm <image>
Removing image: 0% complete...failed.
delete error: image still has watchers
This means the image is still open or the client using it crashed. Try again after closing/unmapping it or waiting 30s for the crashed client to timeout.
2012-08-16 16:46:11.956283 7f8ab8dfc780 -1 librbd: error removing header: (16) Device or resource busy

The fix is to make main() always exit through return(), which will
destroy automatic objects (which properly calls ImageCtx.close()).

Actions #3

Updated by Dan Mick over 11 years ago

  • Status changed from 7 to Resolved

commit:fed8aea662bf919f35a5a72e4e2a2a685af2b2ed in master

Actions

Also available in: Atom PDF