panic on deadlock

This commit is contained in:
Bryan Stitt 2023-07-06 04:18:48 -07:00
parent 5d3751ea88
commit a0b256cbd2
2 changed files with 4 additions and 2 deletions

@ -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 \

@ -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!");
});
}