From a0b256cbd245ee77ff1895216cd90d8517bf8343 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 6 Jul 2023 04:18:48 -0700 Subject: [PATCH] panic on deadlock --- Dockerfile | 2 +- web3_proxy/src/bin/web3_proxy_cli.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25f73377..02420bc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,7 +61,7 @@ RUN --mount=type=cache,target=/root/.cargo/git \ FROM rust as rust_with_env # changing our features doesn't change any of the steps above -ENV WEB3_PROXY_FEATURES "rdkafka-src" +ENV WEB3_PROXY_FEATURES "deadlock_detection,rdkafka-src" # fetch deps RUN --mount=type=bind,target=.,rw \ diff --git a/web3_proxy/src/bin/web3_proxy_cli.rs b/web3_proxy/src/bin/web3_proxy_cli.rs index 37e2fcde..24902eba 100644 --- a/web3_proxy/src/bin/web3_proxy_cli.rs +++ b/web3_proxy/src/bin/web3_proxy_cli.rs @@ -87,7 +87,7 @@ fn main() -> anyhow::Result<()> { // this probably won't matter for us in docker, but better safe than sorry fdlimit::raise_fd_limit(); - #[cfg(feature = "deadlock")] + #[cfg(feature = "deadlock_detection")] { // spawn a thread for deadlock detection thread::spawn(move || loop { @@ -105,6 +105,8 @@ fn main() -> anyhow::Result<()> { println!("{:#?}", t.backtrace()); } } + + panic!("deadlock detected!"); }); }