From 4e72ecedad89415794003d4281de33a9875d9219 Mon Sep 17 00:00:00 2001 From: Franklin Delehelle Date: Fri, 25 Oct 2024 00:08:49 +0200 Subject: [PATCH] fix: show worker backtrace on panic --- lgn-worker/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lgn-worker/src/main.rs b/lgn-worker/src/main.rs index 17bdb10..b16887b 100644 --- a/lgn-worker/src/main.rs +++ b/lgn-worker/src/main.rs @@ -498,6 +498,7 @@ where } }, Err(panic) => { + let bt = std::backtrace::Backtrace::force_capture(); let msg = match panic.downcast_ref::<&'static str>() { Some(s) => *s, None => match panic.downcast_ref::() { @@ -506,12 +507,12 @@ where }, }; - error!("panic encountered during proving: {msg}"); + error!("panic encountered during proving: {msg}: {bt:?}",); counter!("zkmr_worker_error_count", "error_type" => "proof processing") .increment(1); - UpstreamPayload::ProvingError(msg.to_string()) + UpstreamPayload::ProvingError(format!("{}: {bt:?}", msg)) } }; counter!("zkmr_worker_websocket_messages_sent_total",