Skip to content

Commit

Permalink
fix(pstor): when lease is lost exit instead of panic
Browse files Browse the repository at this point in the history
Avoids generating coredumps, as it won't add anything useful here.

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Feb 1, 2024
1 parent 81f812f commit 9d59b06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/pstor/src/etcd_keep_alive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,11 @@ impl LeaseLockKeeperClocking<KeepAlive> for EtcdSingletonLock {
impl LeaseLockKeeperClocking<Replaced> 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);
}
}

Expand Down

0 comments on commit 9d59b06

Please sign in to comment.