Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improvement](spinlock) remove some potential bad spinlock usage (#27904) #41406

Open
wants to merge 2 commits into
base: branch-2.0
Choose a base branch
from

Conversation

cambyzju
Copy link
Contributor

pick #27904 to branch-2.0

(gdb) bt
#0  0x0000564c6d6e023d in doris::SpinLock::lock (this=0x564c784e4c00 <doris::DorisMetrics::instance()::instance+1224>) at /root/be/src/util/spinlock.h:41
#1  std::lock_guard<doris::SpinLock>::lock_guard (__m=..., this=<optimized out>)
    at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_mutex.h:229
#2  doris::MetricRegistry::to_prometheus[abi:cxx11](bool) const (this=0x564c784e4be0 <doris::DorisMetrics::instance()::instance+1192>, 
    with_tablet_metrics=false) at /root/be/src/util/metrics.cpp:325
#3  0x0000564c6db8ca34 in doris::MetricsAction::handle (this=<optimized out>, req=0x564cb4fc06c0) at /root/be/src/http/action/metrics_action.cpp:38
#4  0x0000564c759e2596 in ?? ()
#5  0x0000564c759e1cf3 in ?? ()
#6  0x0000564c759c72e6 in bufferevent_run_readcb_ ()
#7  0x0000564c759e2aff in ?? ()
#8  0x0000564c759d3339 in ?? ()
#9  0x0000564c759cfb3f in event_base_loop ()
#10 0x0000564c6dbc6437 in doris::EvHttpServer::start()::$_0::operator()() const (this=<optimized out>) at /root/be/src/http/ev_http_server.cpp:139
#11 std::__invoke_impl<void, doris::EvHttpServer::start()::$_0&>(std::__invoke_other, doris::EvHttpServer::start()::$_0&) (__f=...)
    at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:61
#12 std::__invoke_r<void, doris::EvHttpServer::start()::$_0&>(doris::EvHttpServer::start()::$_0&) (__fn=...)
    at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:111
#13 std::_Function_handler<void (), doris::EvHttpServer::start()::$_0>::_M_invoke(std::_Any_data const&) (__functor=...)
    at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:291
#14 0x0000564c6d74635f in doris::ThreadPool::dispatch_thread (this=0x564c8211a1c0) at /root/be/src/util/threadpool.cpp:533
#15 0x0000564c6d73c2dc in std::function<void ()>::operator()() const (this=0x7f1e528041d8)
    at /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:560
#16 doris::Thread::supervise_thread (arg=0x564c8211f500) at /root/be/src/util/thread.cpp:498
#17 0x00007f21ca475ea5 in __pthread_mutex_unlock_full () from /lib64/libpthread.so.0
#18 0x0000000000000000 in ?? ()

CPU Usage:
image

…che#27904)

* [improvement](spinlock) remove some potential spinlock usage

---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@cambyzju
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.81% (8146/21545)
Line Coverage: 29.55% (67066/226935)
Region Coverage: 29.02% (34566/119106)
Branch Coverage: 24.94% (17812/71426)
Coverage Report: http://coverage.selectdb-in.cc/coverage/22e6ecc29a0d9294569aae168ff5b45acdd795c2_22e6ecc29a0d9294569aae168ff5b45acdd795c2/report/index.html

@cambyzju
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.82% (8149/21546)
Line Coverage: 29.57% (67103/226957)
Region Coverage: 29.04% (34594/119123)
Branch Coverage: 24.96% (17828/71440)
Coverage Report: http://coverage.selectdb-in.cc/coverage/b37efca1d6535545da95de25a16ca24bfa1cbde7_b37efca1d6535545da95de25a16ca24bfa1cbde7/report/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants