This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new eff076b  [BUG] Fix printing ReservationTrackerCounters cause BE crash 
when mem_limit is reached (#6849)
eff076b is described below

commit eff076b35526d079d85e4fc24702f81aebbbe83c
Author: Xinyi Zou <[email protected]>
AuthorDate: Sat Oct 16 21:57:09 2021 +0800

    [BUG] Fix printing ReservationTrackerCounters cause BE crash when mem_limit 
is reached (#6849)
    
    When the memory usage of BE reaches mem_limit, printing 
ReservationTrackerCounters through MemTracker
    may cause BE crash in high concurrency.
    
    ReservationTrackerCounters is not actually used in the current Doris, and 
the memory tracker in Doris
    will be redesigned in the future.
---
 be/src/runtime/mem_tracker.cpp | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/be/src/runtime/mem_tracker.cpp b/be/src/runtime/mem_tracker.cpp
index ea0a169..ab8a5aa 100644
--- a/be/src/runtime/mem_tracker.cpp
+++ b/be/src/runtime/mem_tracker.cpp
@@ -369,16 +369,19 @@ std::string MemTracker::LogUsage(int max_recursive_depth, 
const string& prefix,
     if (CheckLimitExceeded(MemLimit::HARD)) ss << " memory limit exceeded.";
     if (limit_ > 0) ss << " Limit=" << PrettyPrinter::print(limit_, 
TUnit::BYTES);
 
-    ReservationTrackerCounters* reservation_counters = 
reservation_counters_.load();
-    if (reservation_counters != nullptr) {
-        int64_t reservation = 
reservation_counters->peak_reservation->current_value();
-        ss << " Reservation=" << PrettyPrinter::print(reservation, 
TUnit::BYTES);
-        if (reservation_counters->reservation_limit != nullptr) {
-            int64_t limit = reservation_counters->reservation_limit->value();
-            ss << " ReservationLimit=" << PrettyPrinter::print(limit, 
TUnit::BYTES);
-        }
-        ss << " OtherMemory=" << PrettyPrinter::print(curr_consumption - 
reservation, TUnit::BYTES);
-    }
+    // TODO(zxy): ReservationTrackerCounters is not actually used in the 
current Doris. 
+    // Printing here ReservationTrackerCounters may cause BE crash when high 
concurrency.
+    // The memory tracker in Doris will be redesigned in the future.
+    // ReservationTrackerCounters* reservation_counters = 
reservation_counters_.load();
+    // if (reservation_counters != nullptr) {
+    //     int64_t reservation = 
reservation_counters->peak_reservation->current_value();
+    //     ss << " Reservation=" << PrettyPrinter::print(reservation, 
TUnit::BYTES);
+    //     if (reservation_counters->reservation_limit != nullptr) {
+    //         int64_t limit = 
reservation_counters->reservation_limit->value();
+    //         ss << " ReservationLimit=" << PrettyPrinter::print(limit, 
TUnit::BYTES);
+    //     }
+    //     ss << " OtherMemory=" << PrettyPrinter::print(curr_consumption - 
reservation, TUnit::BYTES);
+    // }
     ss << " Total=" << PrettyPrinter::print(curr_consumption, TUnit::BYTES);
     // Peak consumption is not accurate if the metric is lazily updated (i.e.
     // this is a non-root tracker that exists only for reporting purposes).

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to