]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: add suicide grace to workqueue
authorSage Weil <sage@newdream.net>
Mon, 29 Aug 2011 17:08:08 +0000 (10:08 -0700)
committerSage Weil <sage@newdream.net>
Mon, 29 Aug 2011 18:46:16 +0000 (11:46 -0700)
The main thing we are worried about here are kernel BUGs that kill off our
threads.

Signed-off-by: Sage Weil <sage@newdream.net>
src/common/config.cc
src/common/config.h
src/os/FileStore.cc
src/os/FileStore.h

index 5612417937f8576d3c4adf56462415f712b63545..161058984ca7da14418893b8b3fcfad7106087a0 100644 (file)
@@ -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),
index 97b2c291666fc44780345c2f83774728d6aa4cef..b5d7fb347226f2772c021dbe65c6f759c9a52056 100644 (file)
@@ -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;
 
index 499753e771cae4e80fe4aae2f367647d93b18ba9..6ea03cfbb8f228b52c95791e43280b92ea4e26fb 100644 (file)
@@ -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)
 {
index 3c1e01b70072c7cd48b211dc4e1bbef05b3035ec..6d0d71e90f0e9d9918bcc4d3373246d9f06ca84c 100644 (file)
@@ -172,8 +172,8 @@ class FileStore : public JournalingObjectStore {
   ThreadPool op_tp;
   struct OpWQ : public ThreadPool::WorkQueue<OpSequencer> {
     FileStore *store;
-    OpWQ(FileStore *fs, time_t timeout, ThreadPool *tp)
-      : ThreadPool::WorkQueue<OpSequencer>("FileStore::OpWQ", timeout, 0, tp), store(fs) {}
+    OpWQ(FileStore *fs, time_t timeout, time_t suicide_timeout, ThreadPool *tp)
+      : ThreadPool::WorkQueue<OpSequencer>("FileStore::OpWQ", timeout, suicide_timeout, tp), store(fs) {}
 
     bool _enqueue(OpSequencer *osr) {
       store->op_queue.push_back(osr);