]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
WorkQueue: make wait timeout on empty queue configurable 3941/head
authorSamuel Just <sjust@redhat.com>
Tue, 10 Feb 2015 01:11:38 +0000 (17:11 -0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 11 Mar 2015 00:22:55 +0000 (01:22 +0100)
Fixes: 10817
Backport: giant, firefly, dumpling
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 5aa6f910843e98a05bfcabe6f29d612cf335edbf)

src/common/WorkQueue.cc
src/common/config_opts.h

index 0f8bc9d4f936959ed2b7fd3450ba1b96d759c427..8559b03aa9f1d0d28fbf6878b8a3ee3eb77d53e8 100644 (file)
@@ -142,8 +142,13 @@ void ThreadPool::worker(WorkThread *wt)
     }
 
     ldout(cct,20) << "worker waiting" << dendl;
-    cct->get_heartbeat_map()->reset_timeout(hb, 4, 0);
-    _cond.WaitInterval(cct, _lock, utime_t(2, 0));
+    cct->get_heartbeat_map()->reset_timeout(
+      hb,
+      cct->_conf->threadpool_default_timeout,
+      0);
+    _cond.WaitInterval(cct, _lock,
+      utime_t(
+       cct->_conf->threadpool_empty_queue_max_wait, 0));
   }
   ldout(cct,1) << "worker finish" << dendl;
 
index 03074412a3f353ead748c22538c92fcff1cb9ea7..d8ecdc70357c764a78cff6045c45df1a3059a264 100644 (file)
@@ -570,6 +570,11 @@ OPTION(osd_leveldb_log, OPT_STR, "")  // enable OSD leveldb log file
 // determines whether PGLog::check() compares written out log to stored log
 OPTION(osd_debug_pg_log_writeout, OPT_BOOL, false)
 
+// default timeout while caling WaitInterval on an empty queue
+OPTION(threadpool_default_timeout, OPT_INT, 60)
+// default wait time for an empty queue before pinging the hb timeout
+OPTION(threadpool_empty_queue_max_wait, OPT_INT, 2)
+
 OPTION(leveldb_write_buffer_size, OPT_U64, 8 *1024*1024) // leveldb write buffer size
 OPTION(leveldb_cache_size, OPT_U64, 128 *1024*1024) // leveldb cache size
 OPTION(leveldb_block_size, OPT_U64, 0) // leveldb block size