From 9d59b06df1bf703dc91d8486a5370fc6982b8271 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Thu, 1 Feb 2024 15:27:55 +0000 Subject: [PATCH] fix(pstor): when lease is lost exit instead of panic Avoids generating coredumps, as it won't add anything useful here. Signed-off-by: Tiago Castro --- utils/pstor/src/etcd_keep_alive.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/pstor/src/etcd_keep_alive.rs b/utils/pstor/src/etcd_keep_alive.rs index 454545c18..e12fba98e 100644 --- a/utils/pstor/src/etcd_keep_alive.rs +++ b/utils/pstor/src/etcd_keep_alive.rs @@ -550,10 +550,11 @@ impl LeaseLockKeeperClocking for EtcdSingletonLock { impl LeaseLockKeeperClocking for EtcdSingletonLock { #[tracing::instrument(skip(self, _state), err)] async fn clock(&mut self, _state: Replaced) -> LockStatesResult { - panic!( + eprintln!( "Lost lock to another service instance: {}. Giving up...", self.service_name ); + std::process::exit(128); } }