Skip to content

Commit

Permalink
fix race on signals counter construction (ydb-platform#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Feb 21, 2024
1 parent 11c1356 commit d7ed778
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions ydb/core/tx/columnshard/blobs_action/counters/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ TStorageCounters::TStorageCounters(const TString& storageId)
}

std::shared_ptr<NKikimr::NOlap::NBlobOperations::TConsumerCounters> TStorageCounters::GetConsumerCounter(const TString& consumerId) {
auto it = ConsumerCounters.find(consumerId);
if (it == ConsumerCounters.end()) {
it = ConsumerCounters.emplace(consumerId, std::make_shared<TConsumerCounters>(consumerId, *this)).first;
}
return it->second;
return std::make_shared<TConsumerCounters>(consumerId, *this);
}

TConsumerCounters::TConsumerCounters(const TString& consumerId, const TStorageCounters& parent)
Expand Down
1 change: 0 additions & 1 deletion ydb/core/tx/columnshard/blobs_action/counters/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class TConsumerCounters: public NColumnShard::TCommonCountersOwner {
class TStorageCounters: public NColumnShard::TCommonCountersOwner {
private:
using TBase = NColumnShard::TCommonCountersOwner;
THashMap<TString, std::shared_ptr<TConsumerCounters>> ConsumerCounters;
public:
TStorageCounters(const TString& storageId);

Expand Down

0 comments on commit d7ed778

Please sign in to comment.