Skip to content

Commit

Permalink
osd/OSDMapMapping: fix spurious threadpool timeout errors
Browse files Browse the repository at this point in the history
We were passing a grace of zero seconds to our temporary work queue, which
led to the HeartbeatMap issuing cpu_tp timeout errors to the log.  By using
a non-zero grace period we can avoid these.  Use the same default grace
we use for the workqueue itself when it goes to sleep.

Fixes: https://tracker.ceph.com/issues/53506
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Dec 6, 2021
1 parent cf829d0 commit 30ac5e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/common/WorkQueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ void ThreadPool::worker(WorkThread *wt)
break;
}

if (!_pause && !work_queues.empty()) {
if (work_queues.empty()) {
ldout(cct, 10) << "worker no work queues" << dendl;
} else if (!_pause) {
WorkQueue_* wq;
int tries = 2 * work_queues.size();
bool did = false;
Expand Down
9 changes: 5 additions & 4 deletions src/osd/OSDMapMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ class ParallelPGMapper {
ParallelPGMapper *m;

WQ(ParallelPGMapper *m_, ThreadPool *tp)
: ThreadPool::WorkQueue<Item>("ParallelPGMapper::WQ",
ceph::timespan::zero(),
ceph::timespan::zero(),
tp),
: ThreadPool::WorkQueue<Item>(
"ParallelPGMapper::WQ",
ceph::make_timespan(m_->cct->_conf->threadpool_default_timeout),
ceph::timespan::zero(),
tp),
m(m_) {}

bool _enqueue(Item *i) override {
Expand Down

0 comments on commit 30ac5e7

Please sign in to comment.