Skip to content

Commit

Permalink
Merge pull request #3941 from dachary/wip-10817-firefly
Browse files Browse the repository at this point in the history
WorkQueue: make wait timeout on empty queue configurable

Reviewed-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
ldachary committed Mar 16, 2015
2 parents f95d327 + ca96b59 commit f9acd3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/common/WorkQueue.cc
Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions src/common/config_opts.h
Expand Up @@ -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
Expand Down

0 comments on commit f9acd3a

Please sign in to comment.