diff --git a/core/src/rpc_service.rs b/core/src/rpc_service.rs index e8d874063f..8589e4b0a8 100644 --- a/core/src/rpc_service.rs +++ b/core/src/rpc_service.rs @@ -389,14 +389,14 @@ impl JsonRpcService { .core_threads(rpc_threads) .threaded_scheduler() .enable_all() - .thread_name("sol-rpc-el") + .thread_name("velas-rpc") .build() .unwrap() }; let (close_handle_sender, close_handle_receiver) = channel(); let thread_hdl = Builder::new() - .name("solana-jsonrpc".to_string()) + .name("velas-jsonrpc".to_string()) .spawn(move || { let mut io = MetaIoHandler::default(); diff --git a/metrics/src/metrics.rs b/metrics/src/metrics.rs index 6d55b89e7e..26ad5686f5 100644 --- a/metrics/src/metrics.rs +++ b/metrics/src/metrics.rs @@ -437,10 +437,12 @@ pub fn set_panic_hook(program: &'static str) { Some(location) => location.to_string(), None => "?".to_string(), }; + let ct = thread::current(); + let thread_name = ct.name().unwrap_or("?"); submit( DataPoint::new("panic") .add_field_str("program", program) - .add_field_str("thread", thread::current().name().unwrap_or("?")) + .add_field_str("thread", thread_name) // The 'one' field exists to give Kapacitor Alerts a numerical value // to filter on .add_field_i64("one", 1) @@ -452,8 +454,11 @@ pub fn set_panic_hook(program: &'static str) { // Flush metrics immediately flush(); - // Exit cleanly so the process don't limp along in a half-dead state - std::process::exit(1); + // Keep only rpc threads to avoid DoS on panic + if thread_name != "velas-rpc" { + // Exit cleanly so the process don't limp along in a half-dead state + std::process::exit(1); + } })); }); }