From 08517578e30fa11ea1e548e0f469af8807693a6a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 5 Feb 2016 09:51:59 -0500 Subject: [PATCH] os/bluestore/KernelDevice: use _exit(1) for failure injection This way we don't generate a core file, which spams the log and trips up teuthology. Signed-off-by: Sage Weil --- src/os/bluestore/KernelDevice.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/KernelDevice.cc b/src/os/bluestore/KernelDevice.cc index cbd6f3f61d5f..346b44201839 100644 --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@ -182,7 +182,8 @@ int KernelDevice::flush() derr << __func__ << " injecting crash. first we sleep..." << dendl; sleep(g_conf->bdev_inject_crash_flush_delay); derr << __func__ << " and now we die" << dendl; - assert(0 == "bdev_inject_crash"); + g_ceph_context->_log->flush(); + _exit(1); } utime_t start = ceph_clock_now(NULL); int r = ::fdatasync(fd_direct); @@ -263,8 +264,12 @@ void KernelDevice::_aio_thread() if (g_conf->bdev_inject_crash) { ++inject_crash_count; if (inject_crash_count * g_conf->bdev_aio_poll_ms / 1000 > - g_conf->bdev_inject_crash + g_conf->bdev_inject_crash_flush_delay) - assert(0 == "bdev_inject_crash trigger from aio thread"); + g_conf->bdev_inject_crash + g_conf->bdev_inject_crash_flush_delay) { + derr << __func__ << " bdev_inject_crash trigger from aio thread" + << dendl; + g_ceph_context->_log->flush(); + _exit(1); + } } } dout(10) << __func__ << " end" << dendl; -- 2.47.3