From: Sage Weil Date: Mon, 6 Dec 2021 18:12:50 +0000 (-0500) Subject: osd/OSDMapMapping: fix spurious threadpool timeout errors X-Git-Tag: v17.1.0~257^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=30ac5e79352839e285ec2eef6d603226d9071db4;p=ceph.git osd/OSDMapMapping: fix spurious threadpool timeout errors 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 --- diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index f8e84aeae304f..ea7ff39390201 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -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; diff --git a/src/osd/OSDMapMapping.h b/src/osd/OSDMapMapping.h index 4025917d0ddc1..216c30446a95a 100644 --- a/src/osd/OSDMapMapping.h +++ b/src/osd/OSDMapMapping.h @@ -115,10 +115,11 @@ protected: ParallelPGMapper *m; WQ(ParallelPGMapper *m_, ThreadPool *tp) - : ThreadPool::WorkQueue("ParallelPGMapper::WQ", - ceph::timespan::zero(), - ceph::timespan::zero(), - tp), + : ThreadPool::WorkQueue( + "ParallelPGMapper::WQ", + ceph::make_timespan(m_->cct->_conf->threadpool_default_timeout), + ceph::timespan::zero(), + tp), m(m_) {} bool _enqueue(Item *i) override {