Skip to content

Commit 2f6fb9d

Browse files
authored
Fix failed pulling stats from IC shared thread (ydb-platform#9384)
1 parent 10057bc commit 2f6fb9d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ydb/library/actors/core/executor_pool_shared.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ void TSharedExecutorPool::GiveHalfThread(i16 from, i16 to) {
143143
}
144144

145145
void TSharedExecutorPool::GetSharedStats(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
146-
statsCopy.resize(SharedThreadCount + 1);
146+
statsCopy.resize(SharedThreadCount);
147147
for (i16 i = 0; i < SharedThreadCount; ++i) {
148-
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i + 1]);
148+
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i]);
149149
}
150150
}
151151

152152
void TSharedExecutorPool::GetSharedStatsForHarmonizer(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
153-
statsCopy.resize(SharedThreadCount + 1);
153+
statsCopy.resize(SharedThreadCount);
154154
for (i16 i = 0; i < SharedThreadCount; ++i) {
155-
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i + 1]);
155+
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i]);
156156
}
157157
}
158158

ydb/library/actors/core/harmonizer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ void THarmonizer::HarmonizeImpl(ui64 ts) {
625625
i64 threadCount = pool.GetFullThreadCount();
626626
if (hasSharedThread[poolIdx] && !hasSharedThreadWhichWasNotBorrowed[poolIdx]) {
627627
Shared->ReturnOwnHalfThread(poolIdx);
628+
overbooked -= 0.5;
628629
}
629630
while (threadCount > pool.DefaultFullThreadCount) {
630631
pool.SetFullThreadCount(--threadCount);
@@ -809,6 +810,8 @@ void THarmonizer::AddPool(IExecutorPool* pool, TSelfPingInfo *pingInfo) {
809810
if (poolInfo.BasicPool) {
810811
poolInfo.WaitingStats.reset(new TWaitingStats<ui64>());
811812
poolInfo.MovingWaitingStats.reset(new TWaitingStats<double>());
813+
} else {
814+
poolInfo.DefaultThreadCount = 0;
812815
}
813816
PriorityOrder.clear();
814817
}

0 commit comments

Comments
 (0)