Bug #2948
closedrbd: fails to close image on error
0%
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.
Updated by Josh Durgin over 11 years ago
- Status changed from 12 to 7
- Assignee changed from Josh Durgin to Dan Mick
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()).
Updated by Dan Mick over 11 years ago
- Status changed from 7 to Resolved
commit:fed8aea662bf919f35a5a72e4e2a2a685af2b2ed in master