rocksdb: call spdk_app_stop before exit the process

For some other reason when the host didn't have a block
device e.g: "Nvme0n1", we will call exit(1) directly in
the process, the ASAN will report memory leak issue, so
before exiting the process, we call spdk_app_stop to
do the cleanup.

Fix issue #1422.

Change-Id: I7b7a05807625586bd5b97dc31f41e2b86e1b323f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3586
Community-CI: Mellanox Build Bot
Reviewed-by: JinYu <jin.yu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Changpeng Liu 2020-07-29 20:37:27 -04:00 committed by Tomasz Zawadzki
parent 6967fec6df
commit da60639f86

View File

@ -671,6 +671,7 @@ rocksdb_run(__attribute__((unused)) void *arg1)
if (bdev == NULL) {
SPDK_ERRLOG("bdev %s not found\n", g_bdev_name.c_str());
spdk_app_stop(0);
exit(1);
}