]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
WorkQueue: make wait timeout on empty queue configurable
authorSamuel Just <sjust@redhat.com>
Tue, 10 Feb 2015 01:11:38 +0000 (17:11 -0800)
committerSamuel Just <sjust@redhat.com>
Tue, 10 Feb 2015 02:30:35 +0000 (18:30 -0800)
Fixes: 10817
Backport: giant, firefly, dumpling
Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/WorkQueue.cc
src/common/config_opts.h

index 5c7fefc434930dbb6e764c5e5303eca78cbfb27f..9d38f08e5388c24dcafe79088195c9ddbe84ecf9 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 6037640b7ec67f1379455cab210451844d0718a3..b18561b681044e8e1aeec10777505d68a4bdb519 100644 (file)
@@ -650,6 +650,11 @@ OPTION(osd_pg_object_context_cache_count, OPT_INT, 64)
 // 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