This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new d92c2f1b5ec [cherry-pick](branch-2.1)Change spin lock to mutex
(#43551)
d92c2f1b5ec is described below
commit d92c2f1b5ec14f5e01d8e750342fa19a09ab73c0
Author: kkop <[email protected]>
AuthorDate: Tue Nov 12 14:28:26 2024 +0800
[cherry-pick](branch-2.1)Change spin lock to mutex (#43551)
pick from master:https://github.com/apache/doris/pull/41384
---
be/src/runtime/load_channel.cpp | 6 +++---
be/src/runtime/load_channel.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/be/src/runtime/load_channel.cpp b/be/src/runtime/load_channel.cpp
index cd86705c831..95ca16a9af8 100644
--- a/be/src/runtime/load_channel.cpp
+++ b/be/src/runtime/load_channel.cpp
@@ -108,7 +108,7 @@ Status LoadChannel::open(const PTabletWriterOpenRequest&
params) {
channel =
std::make_shared<TabletsChannel>(*StorageEngine::instance(), key, _load_id,
_is_high_priority,
_self_profile);
{
- std::lock_guard<SpinLock> l(_tablets_channels_lock);
+ std::lock_guard<std::mutex> l(_tablets_channels_lock);
_tablets_channels.insert({index_id, channel});
}
}
@@ -210,7 +210,7 @@ Status LoadChannel::_handle_eos(BaseTabletsChannel* channel,
if (finished) {
std::lock_guard<std::mutex> l(_lock);
{
- std::lock_guard<SpinLock> l(_tablets_channels_lock);
+ std::lock_guard<std::mutex> l(_tablets_channels_lock);
_tablets_channels_rows.insert(std::make_pair(
index_id,
std::make_pair(channel->total_received_rows(),
channel->num_rows_filtered())));
@@ -236,7 +236,7 @@ void
LoadChannel::_report_profile(PTabletWriterAddBlockResult* response) {
_self_profile->set_timestamp(_last_updated_time);
{
- std::lock_guard<SpinLock> l(_tablets_channels_lock);
+ std::lock_guard<std::mutex> l(_tablets_channels_lock);
for (auto& it : _tablets_channels) {
it.second->refresh_profile();
}
diff --git a/be/src/runtime/load_channel.h b/be/src/runtime/load_channel.h
index 791e996574a..9f47a7d7e51 100644
--- a/be/src/runtime/load_channel.h
+++ b/be/src/runtime/load_channel.h
@@ -104,7 +104,7 @@ private:
std::unordered_map<int64_t, std::shared_ptr<BaseTabletsChannel>>
_tablets_channels;
// index id -> (received rows, filtered rows)
std::unordered_map<int64_t, std::pair<size_t, size_t>>
_tablets_channels_rows;
- SpinLock _tablets_channels_lock;
+ std::mutex _tablets_channels_lock;
// This is to save finished channels id, to handle the retry request.
std::unordered_set<int64_t> _finished_channel_ids;
// set to true if at least one tablets channel has been opened
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]