]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/KernelDevice: use _exit(1) for failure injection 7486/head
authorSage Weil <sage@redhat.com>
Fri, 5 Feb 2016 14:51:59 +0000 (09:51 -0500)
committerSage Weil <sage@redhat.com>
Fri, 5 Feb 2016 14:51:59 +0000 (09:51 -0500)
This way we don't generate a core file, which spams the log and trips up
teuthology.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/KernelDevice.cc

index cbd6f3f61d5f1547587a097909273abcc23213fc..346b4420183995ffb0f11942b8d4b380758b0820 100644 (file)
@@ -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;