From 502cf0b239eeaafb2b70cdf6cb5bdd4ab8d8b664 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 29 Aug 2011 10:08:08 -0700 Subject: [PATCH] filestore: add suicide grace to workqueue The main thing we are worried about here are kernel BUGs that kill off our threads. Signed-off-by: Sage Weil --- src/common/config.cc | 1 + src/common/config.h | 1 + src/os/FileStore.cc | 3 ++- src/os/FileStore.h | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/config.cc b/src/common/config.cc index 5612417937f85..161058984ca7d 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -404,6 +404,7 @@ struct config_option config_optionsp[] = { OPTION(filestore_queue_committing_max_bytes, OPT_INT, 100 << 20), // " OPTION(filestore_op_threads, OPT_INT, 2), OPTION(filestore_op_thread_timeout, OPT_INT, 60), + OPTION(filestore_op_thread_suicide_timeout, OPT_INT, 180), OPTION(filestore_commit_timeout, OPT_FLOAT, 600), OPTION(filestore_fiemap_threshold, OPT_INT, 4096), OPTION(journal_dio, OPT_BOOL, true), diff --git a/src/common/config.h b/src/common/config.h index 97b2c291666fc..b5d7fb347226f 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -532,6 +532,7 @@ public: int filestore_queue_committing_max_bytes; int filestore_op_threads; int filestore_op_thread_timeout; + int filestore_op_thread_suicide_timeout; float filestore_commit_timeout; int filestore_fiemap_threshold; diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 499753e771cae..6ea03cfbb8f22 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -873,7 +873,8 @@ FileStore::FileStore(const std::string &base, const std::string &jdev) : stop(false), sync_thread(this), op_queue_len(0), op_queue_bytes(0), op_finisher(g_ceph_context), next_finish(0), op_tp(g_ceph_context, "FileStore::op_tp", g_conf->filestore_op_threads), - op_wq(this, g_conf->filestore_op_thread_timeout, &op_tp), + op_wq(this, g_conf->filestore_op_thread_timeout, + g_conf->filestore_op_thread_suicide_timeout, &op_tp), flusher_queue_len(0), flusher_thread(this), logger(NULL) { diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 3c1e01b70072c..6d0d71e90f0e9 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -172,8 +172,8 @@ class FileStore : public JournalingObjectStore { ThreadPool op_tp; struct OpWQ : public ThreadPool::WorkQueue { FileStore *store; - OpWQ(FileStore *fs, time_t timeout, ThreadPool *tp) - : ThreadPool::WorkQueue("FileStore::OpWQ", timeout, 0, tp), store(fs) {} + OpWQ(FileStore *fs, time_t timeout, time_t suicide_timeout, ThreadPool *tp) + : ThreadPool::WorkQueue("FileStore::OpWQ", timeout, suicide_timeout, tp), store(fs) {} bool _enqueue(OpSequencer *osr) { store->op_queue.push_back(osr); -- 2.39.5