Skip to content

Commit 2244e86

Browse files
committed
scheduler: modify stf info scan procedure
1 parent 3198a29 commit 2244e86

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/TfScheduler/TfSchedulerStfInfo.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ void TfSchedulerStfInfo::SchedulingThread()
157157
const auto &lLastStfInfo = lStfInfoVec.back();
158158
const auto lTimeDiff = std::chrono::abs(lLastStfInfo.mUpdateLocalTime - lNow);
159159
if (lTimeDiff > sStfReapTime) {
160-
LOG(WARNING) << "Reaping SubTimeFrames with ID: " << lStfId
161-
<< ". Received STF infos: "
162-
<< lStfInfoVec.size() << " / " << lNumStfSenders;
160+
LOG(WARNING) << "Reaping SubTimeFrames. Received STF infos: "
161+
<< lStfInfoVec.size() << " / " << lNumStfSenders
162+
<<" stf_id=" << lStfId;
163163

164164
// find missing StfSenders
165165
std::set<std::string> lMissingStfSenders = lStfSenderIdSet;

src/TfScheduler/TfSchedulerTfBuilderInfo.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,18 @@ void TfSchedulerTfBuilderInfo::HousekeepingThread()
124124
{
125125
using namespace std::chrono_literals;
126126
LOG(DEBUG) << "Starting TfBuilderInfo-Housekeeping thread...";
127-
// wait for the device to go into RUNNING state
128127

129128
std::vector<std::string> lIdsToErase;
130129

131130
while (mRunning) {
132-
const auto lNow = std::chrono::system_clock::now();
131+
132+
std::this_thread::sleep_for(1000ms);
133133

134134
{
135135
std::scoped_lock lLock(mGlobalInfoLock);
136136

137+
const auto lNow = std::chrono::system_clock::now();
138+
137139
// reap stale TfBuilders
138140
assert (lIdsToErase.empty());
139141
for (const auto &lIdInfo : mGlobalInfo) {
@@ -143,22 +145,20 @@ void TfSchedulerTfBuilderInfo::HousekeepingThread()
143145
lIdsToErase.emplace_back(lInfo->mTfBuilderUpdate.info().process_id());
144146
}
145147

146-
LOG(DEBUG) << "TfBuilder : " << lInfo->mTfBuilderUpdate.info().process_id()
147-
<< "\n Free Memory : " << lInfo->mTfBuilderUpdate.free_memory()
148-
<< "\n num_buffered_tfs : " << lInfo->mTfBuilderUpdate.num_buffered_tfs();
148+
LOG(DEBUG) << "TfBuilder info id=" << lInfo->mTfBuilderUpdate.info().process_id()
149+
<< " free_mem=" << lInfo->mTfBuilderUpdate.free_memory()
150+
<< " num_buffered_tfs=" << lInfo->mTfBuilderUpdate.num_buffered_tfs();
149151
}
150152

151153
if (!lIdsToErase.empty()) {
152154
for (const auto &lId : lIdsToErase) {
153155
mGlobalInfo.erase(lId);
154156
removeReadyTfBuilder(lId);
155-
LOG (INFO) << "TfBuilder removed from scheduling (stale info), id: " << lId;
157+
LOG (INFO) << "TfBuilder removed from scheduling (stale info), id=" << lId;
156158
}
157159
lIdsToErase.clear();
158160
}
159-
} // mGlobalInfoLock unlock
160-
161-
std::this_thread::sleep_for(1000ms);
161+
} // mGlobalInfoLock unlock (to be able to sleep)
162162
}
163163

164164
LOG(DEBUG) << "Exiting TfBuilderInfo-Housekeeping thread...";

src/TfScheduler/TfSchedulerTfBuilderInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class TfSchedulerTfBuilderInfo
181181
static constexpr std::uint64_t sTfSizeOverestimatePercent = 20;
182182

183183
/// Reap time for non-complete TFs
184-
static constexpr auto sTfBuilderReapTime = 2s;
184+
static constexpr auto sTfBuilderReapTime = 5s;
185185

186186
/// Discovery configuration
187187
std::shared_ptr<ConsulTfSchedulerInstance> mDiscoveryConfig;

0 commit comments

Comments
 (0)