From: Samuel Just Date: Tue, 10 Feb 2015 01:11:38 +0000 (-0800) Subject: WorkQueue: make wait timeout on empty queue configurable X-Git-Tag: v0.80.10~56^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3941%2Fhead;p=ceph.git WorkQueue: make wait timeout on empty queue configurable Fixes: 10817 Backport: giant, firefly, dumpling Signed-off-by: Samuel Just (cherry picked from commit 5aa6f910843e98a05bfcabe6f29d612cf335edbf) --- diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index 0f8bc9d4f9369..8559b03aa9f1d 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -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; diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 03074412a3f35..d8ecdc70357c7 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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