Skip to content

Commit d56b8b1

Browse files
kruallAleksandr Kriukov
and
Aleksandr Kriukov
authored
Fix metric PotentialMaxThreadCount (#629)
Co-authored-by: Aleksandr Kriukov <[email protected]>
1 parent c289f6b commit d56b8b1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ydb/library/actors/core/harmonizer.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,6 @@ void THarmonizer::HarmonizeImpl(ui64 ts) {
467467
if (budget < -0.1) {
468468
isStarvedPresent = true;
469469
}
470-
for (size_t poolIdx = 0; poolIdx < Pools.size(); ++poolIdx) {
471-
TPoolInfo& pool = Pools[poolIdx];
472-
AtomicSet(pool.PotentialMaxThreadCount, Min(pool.MaxThreadCount, budgetInt));
473-
}
474470
double overbooked = consumed - booked;
475471
if (overbooked < 0) {
476472
isStarvedPresent = false;
@@ -591,6 +587,11 @@ void THarmonizer::HarmonizeImpl(ui64 ts) {
591587
pool.SetThreadCount(threadCount - 1);
592588
}
593589
}
590+
591+
for (size_t poolIdx = 0; poolIdx < Pools.size(); ++poolIdx) {
592+
TPoolInfo& pool = Pools[poolIdx];
593+
AtomicSet(pool.PotentialMaxThreadCount, std::min<i64>(pool.MaxThreadCount, pool.GetThreadCount() + budgetInt));
594+
}
594595
}
595596

596597
void THarmonizer::CalculatePriorityOrder() {

0 commit comments

Comments
 (0)