Skip to content

Commit

Permalink
fix(java_binding): fix java binding TLS allocation failure (#12862)
Browse files Browse the repository at this point in the history
Co-authored-by: chenzl25 <[email protected]>
Co-authored-by: xxchan <[email protected]>
  • Loading branch information
3 people authored Oct 17, 2023
1 parent 1c2e5aa commit 34ec260
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 14 deletions.
17 changes: 16 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
1 change: 0 additions & 1 deletion src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
30 changes: 30 additions & 0 deletions src/common/heap_profiling/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub mod test_utils;
pub mod types;
pub mod vnode_mapping;

pub mod heap_profiling;
pub mod range;

pub mod test_prelude {
Expand Down
1 change: 1 addition & 0 deletions src/compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
10 changes: 6 additions & 4 deletions src/compute/src/rpc/service/monitor_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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))?;
Expand Down
2 changes: 1 addition & 1 deletion src/compute/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ 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;
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;
Expand Down
1 change: 1 addition & 0 deletions src/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/dashboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/storage/compactor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion src/storage/compactor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 34ec260

Please sign in to comment.