github-actions[bot] commented on code in PR #42006: URL: https://github.com/apache/doris/pull/42006#discussion_r1839297664
########## be/src/olap/olap_server.cpp: ########## @@ -210,7 +210,7 @@ static int32_t get_single_replica_compaction_threads_num(size_t data_dirs_num) { return threads_num; } -Status StorageEngine::start_bg_threads() { +Status StorageEngine::start_bg_threads(std::shared_ptr<WorkloadGroup> wg_sptr) { Review Comment: warning: function 'start_bg_threads' has cognitive complexity of 110 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status StorageEngine::start_bg_threads(std::shared_ptr<WorkloadGroup> wg_sptr) { ^ ``` <details> <summary>Additional context</summary> **be/src/olap/olap_server.cpp:213:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:213:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:219:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:219:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:226:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:226:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:232:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:232:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:245:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (wg_sptr->get_cgroup_cpu_ctl_wptr().lock()) { ^ ``` **be/src/olap/olap_server.cpp:246:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gBaseCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:246:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gBaseCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:251:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gCumuCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:251:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gCumuCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:256:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gSingleReplicaCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:256:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gSingleReplicaCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:262:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (config::enable_segcompaction) { ^ ``` **be/src/olap/olap_server.cpp:263:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gSegCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:263:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gSegCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:269:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gColdDataCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:269:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("gColdDataCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:274:** +1, nesting level increased to 1 ```cpp } else { ^ ``` **be/src/olap/olap_server.cpp:275:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("BaseCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:275:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("BaseCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:279:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("CumuCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:279:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("CumuCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:283:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("SingleReplicaCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:283:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("SingleReplicaCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:288:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (config::enable_segcompaction) { ^ ``` **be/src/olap/olap_server.cpp:289:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("SegCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:289:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("SegCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:294:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("ColdDataCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:294:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("ColdDataCompactionTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:301:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:301:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:307:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:307:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:313:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (max_checkpoint_thread_num < 0) { ^ ``` **be/src/olap/olap_server.cpp:316:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("TabletMetaCheckpointTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:316:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("TabletMetaCheckpointTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:320:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("MultiGetTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:320:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("MultiGetTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:324:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:324:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:330:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:330:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:336:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (config::path_gc_check) { ^ ``` **be/src/olap/olap_server.cpp:348:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("CooldownTaskThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:348:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("CooldownTaskThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:354:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:354:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:360:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:360:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:366:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:366:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:373:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("TabletPublishTxnThreadPool") ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:373:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(ThreadPoolBuilder("TabletPublishTxnThreadPool") ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/olap/olap_server.cpp:378:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:630:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/olap/olap_server.cpp:378:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(Thread::create( ^ ``` **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org