Skip to content

Commit 7d29444

Browse files
committed
Fixed scheduler fails
1 parent 0cffab3 commit 7d29444

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

ydb/core/kqp/node_service/kqp_node_service.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class TKqpNodeService : public TActorBootstrapped<TKqpNodeService> {
210210
share = 1.0;
211211
}
212212
std::optional<double> resourceWeight;
213-
if (msg.GetResourceWeight() >= 0) {
213+
if (msg.HasResourceWeight() && msg.GetResourceWeight() >= 0) {
214214
resourceWeight = msg.GetResourceWeight();
215215
}
216216

ydb/core/kqp/runtime/kqp_compute_scheduler.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,17 @@ class TObservableUpdater {
188188

189189
void CollectValues() {
190190
std::vector<TParameterKey> toerase;
191-
for (auto& [k, v] : Params) {
192-
if (!v.Holder->HasDependents()) {
193-
toerase.push_back(k);
191+
do {
192+
toerase.clear();
193+
for (auto& [k, v] : Params) {
194+
if (!v.Holder->HasDependents()) {
195+
toerase.push_back(k);
196+
}
194197
}
195-
}
196-
for (auto& key : toerase) {
197-
Params.erase(key);
198-
}
198+
for (auto& key : toerase) {
199+
Params.erase(key);
200+
}
201+
} while (!toerase.empty());
199202
}
200203

201204
private:
@@ -897,7 +900,8 @@ class TCompositeGroupShare : public IObservableValue<double> {
897900
protected:
898901
double DoUpdateValue() override {
899902
if (ResourceWeightEnabled->GetValue()) {
900-
if (ResourceWeightLimit->Enabled()->GetValue()) {
903+
auto limitEnabled = ResourceWeightLimit->Enabled();
904+
if (limitEnabled->GetValue()) {
901905
return Min(TotalLimit->GetValue(), ResourceWeightLimit->GetValue());
902906
} else {
903907
return 0;

ydb/core/tx/conveyor/service/service.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ void TWorkersPool::ReleaseWorker(const ui32 workerIdx) {
4646

4747
void TWorkersPool::ChangeAmountCPULimit(const double delta) {
4848
AmountCPULimit += delta;
49+
if (std::abs(AmountCPULimit) < Eps) {
50+
AmountCPULimit = 0;
51+
}
4952
AFL_VERIFY(AmountCPULimit >= 0);
5053
Counters.AmountCPULimit->Set(AmountCPULimit);
5154
Counters.ChangeCPULimitRate->Inc();

0 commit comments

Comments
 (0)