From fe6820b1bbc677895a1a8edfadc3bab71d041470 Mon Sep 17 00:00:00 2001 From: Dylan Chen Date: Mon, 16 Oct 2023 14:37:04 +0800 Subject: [PATCH 1/8] fix --- src/java_binding/src/lib.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/java_binding/src/lib.rs b/src/java_binding/src/lib.rs index 6edf4d29ce557..aa7e564ed1ace 100644 --- a/src/java_binding/src/lib.rs +++ b/src/java_binding/src/lib.rs @@ -12,18 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![feature(result_option_inspect)] - -use std::ffi::c_void; - -use jni::sys::{jint, JNI_VERSION_1_2}; -use jni::JavaVM; -use risingwave_jni_core::register_native_method_for_jvm; - -#[no_mangle] -#[allow(non_snake_case)] -pub extern "system" fn JNI_OnLoad(jvm: JavaVM, _reserved: *mut c_void) -> jint { - let _ = register_native_method_for_jvm(&jvm) - .inspect_err(|_e| eprintln!("unable to register native method")); - JNI_VERSION_1_2 -} +pub use risingwave_jni_core::*; From 2292ba0dd7bd68a8c2c30d7fe28b580e1124ed3c Mon Sep 17 00:00:00 2001 From: Dylan Chen Date: Tue, 17 Oct 2023 14:29:08 +0800 Subject: [PATCH 2/8] add disable_initial_exec_tls feature to common --- src/common/Cargo.toml | 4 ++++ src/java_binding/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index fd105333f645d..df676f0650183 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -158,3 +158,7 @@ path = "src/bin/default_config.rs" [lints] workspace = true + +[features] +default = [] +disable_initial_exec_tls = ["tikv-jemalloc-ctl/disable_initial_exec_tls"] \ No newline at end of file diff --git a/src/java_binding/Cargo.toml b/src/java_binding/Cargo.toml index 477f19878cbd9..21351863e9d65 100644 --- a/src/java_binding/Cargo.toml +++ b/src/java_binding/Cargo.toml @@ -12,7 +12,7 @@ normal = ["workspace-hack"] [dependencies] jni = "0.21.1" prost = { workspace = true } -risingwave_common = { workspace = true } +risingwave_common = { workspace = true, features = ["disable_initial_exec_tls"] } risingwave_jni_core = { workspace = true } risingwave_pb = { workspace = true } serde = { version = "1.0", features = ["derive"] } From 961c4d02a2482c4344af1262c86768e1a12ab9c2 Mon Sep 17 00:00:00 2001 From: chenzl25 Date: Tue, 17 Oct 2023 06:30:45 +0000 Subject: [PATCH 3/8] Fix "cargo-hakari" --- Cargo.lock | 1 + src/workspace-hack/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index dccda78d5bb4e..f060be26c11e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10997,6 +10997,7 @@ dependencies = [ "subtle", "syn 1.0.109", "syn 2.0.37", + "tikv-jemalloc-ctl", "time", "time-macros", "tinyvec", diff --git a/src/workspace-hack/Cargo.toml b/src/workspace-hack/Cargo.toml index 15d296b56b5b3..ae5f234b7a366 100644 --- a/src/workspace-hack/Cargo.toml +++ b/src/workspace-hack/Cargo.toml @@ -118,6 +118,7 @@ sqlx-postgres = { version = "0.7", default-features = false, features = ["any", sqlx-sqlite = { version = "0.7", default-features = false, features = ["any", "chrono", "json", "migrate", "offline", "time", "uuid"] } strum = { version = "0.25", features = ["derive"] } subtle = { version = "2" } +tikv-jemalloc-ctl = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9", features = ["disable_initial_exec_tls"] } time = { version = "0.3", features = ["local-offset", "macros", "serde-well-known"] } tinyvec = { version = "1", features = ["alloc", "grab_spare_slice", "rustc_1_55"] } tokio = { version = "1", features = ["full", "stats", "tracing"] } From 7612fe19af91005313c56d3d7b06d17aa1cebdf1 Mon Sep 17 00:00:00 2001 From: Dylan Chen Date: Tue, 17 Oct 2023 14:39:33 +0800 Subject: [PATCH 4/8] fix --- src/common/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index df676f0650183..1b2fb636ce1e3 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -161,4 +161,4 @@ workspace = true [features] default = [] -disable_initial_exec_tls = ["tikv-jemalloc-ctl/disable_initial_exec_tls"] \ No newline at end of file +disable_initial_exec_tls = ["tikv-jemalloc-ctl/disable_initial_exec_tls"] From b00484014b4c0e468acee3be17dc5df7dafd3565 Mon Sep 17 00:00:00 2001 From: Dylan Chen Date: Tue, 17 Oct 2023 14:41:49 +0800 Subject: [PATCH 5/8] Revert "fix" This reverts commit fe6820b1bbc677895a1a8edfadc3bab71d041470. --- src/java_binding/src/lib.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/java_binding/src/lib.rs b/src/java_binding/src/lib.rs index aa7e564ed1ace..6edf4d29ce557 100644 --- a/src/java_binding/src/lib.rs +++ b/src/java_binding/src/lib.rs @@ -12,4 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -pub use risingwave_jni_core::*; +#![feature(result_option_inspect)] + +use std::ffi::c_void; + +use jni::sys::{jint, JNI_VERSION_1_2}; +use jni::JavaVM; +use risingwave_jni_core::register_native_method_for_jvm; + +#[no_mangle] +#[allow(non_snake_case)] +pub extern "system" fn JNI_OnLoad(jvm: JavaVM, _reserved: *mut c_void) -> jint { + let _ = register_native_method_for_jvm(&jvm) + .inspect_err(|_e| eprintln!("unable to register native method")); + JNI_VERSION_1_2 +} From 6dd77103d97c6fae83997d01565fc004495e8252 Mon Sep 17 00:00:00 2001 From: Dylan Chen Date: Tue, 17 Oct 2023 16:34:52 +0800 Subject: [PATCH 6/8] fix hakari --- .config/hakari.toml | 1 + Cargo.lock | 1 - src/common/Cargo.toml | 1 + src/workspace-hack/Cargo.toml | 1 - 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/hakari.toml b/.config/hakari.toml index c1355e0892334..642e0c1a26740 100644 --- a/.config/hakari.toml +++ b/.config/hakari.toml @@ -37,6 +37,7 @@ third-party = [ # For some reasons, tikv-jemalloc-sys would be compiled twice if being added into `workspace-hack` { name = "tikv-jemalloc-sys", git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }, { name = "tikv-jemallocator", git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }, + { name = "tikv-jemalloc-ctl", git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }, # These are solely dev-dependencies. Unifying them may slow down build. { name = "criterion" }, { name = "console" }, diff --git a/Cargo.lock b/Cargo.lock index f060be26c11e2..dccda78d5bb4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10997,7 +10997,6 @@ dependencies = [ "subtle", "syn 1.0.109", "syn 2.0.37", - "tikv-jemalloc-ctl", "time", "time-macros", "tinyvec", diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index 1b2fb636ce1e3..69f031c5648b3 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -162,3 +162,4 @@ workspace = true [features] default = [] disable_initial_exec_tls = ["tikv-jemalloc-ctl/disable_initial_exec_tls"] + diff --git a/src/workspace-hack/Cargo.toml b/src/workspace-hack/Cargo.toml index ae5f234b7a366..15d296b56b5b3 100644 --- a/src/workspace-hack/Cargo.toml +++ b/src/workspace-hack/Cargo.toml @@ -118,7 +118,6 @@ sqlx-postgres = { version = "0.7", default-features = false, features = ["any", sqlx-sqlite = { version = "0.7", default-features = false, features = ["any", "chrono", "json", "migrate", "offline", "time", "uuid"] } strum = { version = "0.25", features = ["derive"] } subtle = { version = "2" } -tikv-jemalloc-ctl = { git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9", features = ["disable_initial_exec_tls"] } time = { version = "0.3", features = ["local-offset", "macros", "serde-well-known"] } tinyvec = { version = "1", features = ["alloc", "grab_spare_slice", "rustc_1_55"] } tokio = { version = "1", features = ["full", "stats", "tracing"] } From f8f78318e7a1429f4698ddcf89c55d35ba629849 Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 17 Oct 2023 17:34:37 +0800 Subject: [PATCH 7/8] move common/heap_profiling to a separate crate --- .config/hakari.toml | 1 - Cargo.lock | 17 ++++++++++- Cargo.toml | 1 + src/common/Cargo.toml | 6 ---- src/common/heap_profiling/Cargo.toml | 30 +++++++++++++++++++ .../src}/jeprof.rs | 3 +- .../mod.rs => heap_profiling/src/lib.rs} | 0 .../src}/profiler.rs | 2 +- src/common/src/lib.rs | 1 - src/compute/Cargo.toml | 1 + .../src/rpc/service/monitor_service.rs | 2 +- src/compute/src/server.rs | 2 +- src/java_binding/Cargo.toml | 2 +- src/meta/Cargo.toml | 1 + src/meta/src/dashboard/mod.rs | 2 +- src/meta/src/lib.rs | 2 +- src/storage/compactor/Cargo.toml | 1 + src/storage/compactor/src/server.rs | 2 +- 18 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 src/common/heap_profiling/Cargo.toml rename src/common/{src/heap_profiling => heap_profiling/src}/jeprof.rs (97%) rename src/common/{src/heap_profiling/mod.rs => heap_profiling/src/lib.rs} (100%) rename src/common/{src/heap_profiling => heap_profiling/src}/profiler.rs (98%) diff --git a/.config/hakari.toml b/.config/hakari.toml index 642e0c1a26740..c1355e0892334 100644 --- a/.config/hakari.toml +++ b/.config/hakari.toml @@ -37,7 +37,6 @@ third-party = [ # For some reasons, tikv-jemalloc-sys would be compiled twice if being added into `workspace-hack` { name = "tikv-jemalloc-sys", git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }, { name = "tikv-jemallocator", git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }, - { name = "tikv-jemalloc-ctl", git = "https://github.com/risingwavelabs/jemallocator.git", rev = "64a2d9" }, # These are solely dev-dependencies. Unifying them may slow down build. { name = "criterion" }, { name = "console" }, diff --git a/Cargo.lock b/Cargo.lock index dccda78d5bb4e..4828ed27fae82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7097,7 +7097,6 @@ dependencies = [ "sysinfo", "tempfile", "thiserror", - "tikv-jemalloc-ctl", "tinyvec", "toml 0.7.8", "tower-layer", @@ -7111,6 +7110,19 @@ dependencies = [ "workspace-hack", ] +[[package]] +name = "risingwave_common_heap_profiling" +version = "1.3.0-alpha" +dependencies = [ + "anyhow", + "chrono", + "madsim-tokio", + "parking_lot 0.12.1", + "risingwave_common", + "tikv-jemalloc-ctl", + "tracing", +] + [[package]] name = "risingwave_common_proc_macro" version = "1.3.0-alpha" @@ -7181,6 +7193,7 @@ dependencies = [ "parking_lot 0.12.1", "prometheus", "risingwave_common", + "risingwave_common_heap_profiling", "risingwave_common_service", "risingwave_object_store", "risingwave_pb", @@ -7214,6 +7227,7 @@ dependencies = [ "rand", "risingwave_batch", "risingwave_common", + "risingwave_common_heap_profiling", "risingwave_common_service", "risingwave_connector", "risingwave_hummock_sdk", @@ -7666,6 +7680,7 @@ dependencies = [ "reqwest", "risingwave_backup", "risingwave_common", + "risingwave_common_heap_profiling", "risingwave_common_service", "risingwave_connector", "risingwave_hummock_sdk", diff --git a/Cargo.toml b/Cargo.toml index 81d914b416d17..a975a0186e712 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,6 +127,7 @@ risingwave_batch = { path = "./src/batch" } risingwave_cmd = { path = "./src/cmd" } risingwave_common = { path = "./src/common" } risingwave_common_service = { path = "./src/common/common_service" } +risingwave_common_heap_profiling = { path = "./src/common/heap_profiling" } risingwave_compactor = { path = "./src/storage/compactor" } risingwave_compute = { path = "./src/compute" } risingwave_ctl = { path = "./src/ctl" } diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index 69f031c5648b3..a9b1ef1c95d7f 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -86,7 +86,6 @@ strum = "0.25" strum_macros = "0.25" sysinfo = { version = "0.29", default-features = false } thiserror = "1" -tikv-jemalloc-ctl = { workspace = true } tinyvec = { version = "1", features = ["rustc_1_55", "grab_spare_slice"] } tokio = { version = "0.2", package = "madsim-tokio", features = [ "rt", @@ -158,8 +157,3 @@ path = "src/bin/default_config.rs" [lints] workspace = true - -[features] -default = [] -disable_initial_exec_tls = ["tikv-jemalloc-ctl/disable_initial_exec_tls"] - diff --git a/src/common/heap_profiling/Cargo.toml b/src/common/heap_profiling/Cargo.toml new file mode 100644 index 0000000000000..6c1b9957555bd --- /dev/null +++ b/src/common/heap_profiling/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "risingwave_common_heap_profiling" +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +keywords = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[package.metadata.cargo-machete] +ignored = ["workspace-hack"] + +[package.metadata.cargo-udeps.ignore] +normal = ["workspace-hack"] + +[dependencies] +tikv-jemalloc-ctl = { workspace = true } +risingwave_common = {workspace =true} +tokio = { version = "0.2", package = "madsim-tokio" } +tracing = "0.1" +chrono = { version = "0.4", default-features = false, features = [ + "clock", + "std", +] } +anyhow = "1" +parking_lot = "0.12" + +[lints] +workspace = true diff --git a/src/common/src/heap_profiling/jeprof.rs b/src/common/heap_profiling/src/jeprof.rs similarity index 97% rename from src/common/src/heap_profiling/jeprof.rs rename to src/common/heap_profiling/src/jeprof.rs index 5c79c67604418..013632f32838e 100644 --- a/src/common/src/heap_profiling/jeprof.rs +++ b/src/common/heap_profiling/src/jeprof.rs @@ -17,8 +17,7 @@ use std::process::Command; use std::{env, fs}; use anyhow::anyhow; - -use crate::error::Result; +use risingwave_common::error::Result; pub async fn run(profile_path: String, collapsed_path: String) -> Result<()> { let executable_path = env::current_exe()?; diff --git a/src/common/src/heap_profiling/mod.rs b/src/common/heap_profiling/src/lib.rs similarity index 100% rename from src/common/src/heap_profiling/mod.rs rename to src/common/heap_profiling/src/lib.rs diff --git a/src/common/src/heap_profiling/profiler.rs b/src/common/heap_profiling/src/profiler.rs similarity index 98% rename from src/common/src/heap_profiling/profiler.rs rename to src/common/heap_profiling/src/profiler.rs index fbf972d94f2f0..49e81e8526241 100644 --- a/src/common/src/heap_profiling/profiler.rs +++ b/src/common/heap_profiling/src/profiler.rs @@ -17,13 +17,13 @@ use std::fs; use std::path::Path; use parking_lot::Once; +use risingwave_common::config::HeapProfilingConfig; use tikv_jemalloc_ctl::{ epoch as jemalloc_epoch, opt as jemalloc_opt, prof as jemalloc_prof, stats as jemalloc_stats, }; use tokio::time::{self, Duration}; use super::AUTO_DUMP_SUFFIX; -use crate::config::HeapProfilingConfig; pub struct HeapProfiler { config: HeapProfilingConfig, diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs index 86d29213374a0..da58e53b8c52d 100644 --- a/src/common/src/lib.rs +++ b/src/common/src/lib.rs @@ -77,7 +77,6 @@ pub mod test_utils; pub mod types; pub mod vnode_mapping; -pub mod heap_profiling; pub mod range; pub mod test_prelude { diff --git a/src/compute/Cargo.toml b/src/compute/Cargo.toml index 1cf81e6070820..93e4e643dcf04 100644 --- a/src/compute/Cargo.toml +++ b/src/compute/Cargo.toml @@ -29,6 +29,7 @@ pprof = { version = "0.13", features = ["flamegraph"] } prometheus = { version = "0.13" } risingwave_batch = { workspace = true } risingwave_common = { workspace = true } +risingwave_common_heap_profiling = { workspace = true } risingwave_common_service = { workspace = true } risingwave_connector = { workspace = true } risingwave_hummock_sdk = { workspace = true } diff --git a/src/compute/src/rpc/service/monitor_service.rs b/src/compute/src/rpc/service/monitor_service.rs index ea95a87574572..58287312ecebb 100644 --- a/src/compute/src/rpc/service/monitor_service.rs +++ b/src/compute/src/rpc/service/monitor_service.rs @@ -20,7 +20,7 @@ use std::time::Duration; use itertools::Itertools; use risingwave_common::config::ServerConfig; -use risingwave_common::heap_profiling::{ +use risingwave_common_heap_profiling::{ self, AUTO_DUMP_SUFFIX, COLLAPSED_SUFFIX, MANUALLY_DUMP_SUFFIX, }; use risingwave_pb::monitor_service::monitor_service_server::MonitorService; diff --git a/src/compute/src/server.rs b/src/compute/src/server.rs index 02d7d6683ea8c..bfa2ad6584090 100644 --- a/src/compute/src/server.rs +++ b/src/compute/src/server.rs @@ -26,7 +26,6 @@ use risingwave_common::config::{ load_config, AsyncStackTraceOption, MetricLevel, StorageMemoryConfig, MAX_CONNECTION_WINDOW_SIZE, STREAM_WINDOW_SIZE, }; -use risingwave_common::heap_profiling::HeapProfiler; use risingwave_common::monitor::connection::{RouterExt, TcpConfig}; use risingwave_common::system_param::local_manager::LocalSystemParamsManager; use risingwave_common::telemetry::manager::TelemetryManager; @@ -34,6 +33,7 @@ use risingwave_common::telemetry::telemetry_env_enabled; use risingwave_common::util::addr::HostAddr; use risingwave_common::util::pretty_bytes::convert; use risingwave_common::{GIT_SHA, RW_VERSION}; +use risingwave_common_heap_profiling::HeapProfiler; use risingwave_common_service::metrics_manager::MetricsManager; use risingwave_common_service::observer_manager::ObserverManager; use risingwave_common_service::tracing::TracingExtractLayer; diff --git a/src/java_binding/Cargo.toml b/src/java_binding/Cargo.toml index 21351863e9d65..477f19878cbd9 100644 --- a/src/java_binding/Cargo.toml +++ b/src/java_binding/Cargo.toml @@ -12,7 +12,7 @@ normal = ["workspace-hack"] [dependencies] jni = "0.21.1" prost = { workspace = true } -risingwave_common = { workspace = true, features = ["disable_initial_exec_tls"] } +risingwave_common = { workspace = true } risingwave_jni_core = { workspace = true } risingwave_pb = { workspace = true } serde = { version = "1.0", features = ["derive"] } diff --git a/src/meta/Cargo.toml b/src/meta/Cargo.toml index f9876eb9cfe25..1478d9e34e5be 100644 --- a/src/meta/Cargo.toml +++ b/src/meta/Cargo.toml @@ -49,6 +49,7 @@ regex = "1" reqwest = "0.11" risingwave_backup = { workspace = true } risingwave_common = { workspace = true } +risingwave_common_heap_profiling = { workspace = true } risingwave_common_service = { workspace = true } risingwave_connector = { workspace = true } risingwave_hummock_sdk = { workspace = true } diff --git a/src/meta/src/dashboard/mod.rs b/src/meta/src/dashboard/mod.rs index e00b87b0ed9a4..a184bc9155e68 100644 --- a/src/meta/src/dashboard/mod.rs +++ b/src/meta/src/dashboard/mod.rs @@ -57,7 +57,7 @@ pub(super) mod handlers { use axum::Json; use itertools::Itertools; use risingwave_common::bail; - use risingwave_common::heap_profiling::COLLAPSED_SUFFIX; + use risingwave_common_heap_profiling::COLLAPSED_SUFFIX; use risingwave_pb::catalog::table::TableType; use risingwave_pb::catalog::{Sink, Source, Table}; use risingwave_pb::common::WorkerNode; diff --git a/src/meta/src/lib.rs b/src/meta/src/lib.rs index 5fa90a77d48cb..7a147274a8d2f 100644 --- a/src/meta/src/lib.rs +++ b/src/meta/src/lib.rs @@ -55,9 +55,9 @@ use std::time::Duration; use clap::Parser; pub use error::{MetaError, MetaResult}; use risingwave_common::config::OverrideConfig; -use risingwave_common::heap_profiling::HeapProfiler; use risingwave_common::util::resource_util; use risingwave_common::{GIT_SHA, RW_VERSION}; +use risingwave_common_heap_profiling::HeapProfiler; pub use rpc::{ElectionClient, ElectionMember, EtcdElectionClient}; use crate::manager::MetaOpts; diff --git a/src/storage/compactor/Cargo.toml b/src/storage/compactor/Cargo.toml index f4118ff639b5d..54d48a88923a6 100644 --- a/src/storage/compactor/Cargo.toml +++ b/src/storage/compactor/Cargo.toml @@ -22,6 +22,7 @@ clap = { version = "4", features = ["derive"] } parking_lot = "0.12" prometheus = { version = "0.13" } risingwave_common = { workspace = true } +risingwave_common_heap_profiling = { workspace = true } risingwave_common_service = { workspace = true } risingwave_object_store = { workspace = true } risingwave_pb = { workspace = true } diff --git a/src/storage/compactor/src/server.rs b/src/storage/compactor/src/server.rs index 627cd3491d78f..3ad23bf68cc3b 100644 --- a/src/storage/compactor/src/server.rs +++ b/src/storage/compactor/src/server.rs @@ -21,7 +21,6 @@ use parking_lot::RwLock; use risingwave_common::config::{ extract_storage_memory_config, load_config, AsyncStackTraceOption, MetricLevel, RwConfig, }; -use risingwave_common::heap_profiling::HeapProfiler; use risingwave_common::monitor::connection::{RouterExt, TcpConfig}; use risingwave_common::system_param::local_manager::LocalSystemParamsManager; use risingwave_common::system_param::reader::SystemParamsReader; @@ -30,6 +29,7 @@ use risingwave_common::telemetry::telemetry_env_enabled; use risingwave_common::util::addr::HostAddr; use risingwave_common::util::resource_util; use risingwave_common::{GIT_SHA, RW_VERSION}; +use risingwave_common_heap_profiling::HeapProfiler; use risingwave_common_service::metrics_manager::MetricsManager; use risingwave_common_service::observer_manager::ObserverManager; use risingwave_object_store::object::object_metrics::GLOBAL_OBJECT_STORE_METRICS; From 3c037ff0dbbee0c7ca3af6b452d3e6b76daeede3 Mon Sep 17 00:00:00 2001 From: xxchan Date: Tue, 17 Oct 2023 17:40:02 +0800 Subject: [PATCH 8/8] fix --- src/compute/src/rpc/service/monitor_service.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compute/src/rpc/service/monitor_service.rs b/src/compute/src/rpc/service/monitor_service.rs index 58287312ecebb..565a7af2467ec 100644 --- a/src/compute/src/rpc/service/monitor_service.rs +++ b/src/compute/src/rpc/service/monitor_service.rs @@ -20,9 +20,7 @@ use std::time::Duration; use itertools::Itertools; use risingwave_common::config::ServerConfig; -use risingwave_common_heap_profiling::{ - self, AUTO_DUMP_SUFFIX, COLLAPSED_SUFFIX, MANUALLY_DUMP_SUFFIX, -}; +use risingwave_common_heap_profiling::{AUTO_DUMP_SUFFIX, COLLAPSED_SUFFIX, MANUALLY_DUMP_SUFFIX}; use risingwave_pb::monitor_service::monitor_service_server::MonitorService; use risingwave_pb::monitor_service::{ AnalyzeHeapRequest, AnalyzeHeapResponse, HeapProfilingRequest, HeapProfilingResponse, @@ -219,7 +217,11 @@ impl MonitorService for MonitorServiceImpl { // run jeprof if the target was not analyzed before if !collapsed_path.exists() { - heap_profiling::jeprof::run(dumped_path_str, collapsed_path_str.clone()).await?; + risingwave_common_heap_profiling::jeprof::run( + dumped_path_str, + collapsed_path_str.clone(), + ) + .await?; } let file = fs::read(Path::new(&collapsed_path_str))?;