If an error happens while checking for core dumps, don't panic.

If we panic, we skip the 30s wait in 'main', and don't give the
console a chance to observe the error. Which is not nice.

Spotted by @ololobus at
https://github.com/neondatabase/neon/pull/3352#discussion_r1072806981
This commit is contained in:
Heikki Linnakangas
2023-01-18 02:29:05 +02:00
committed by Heikki Linnakangas
parent c6b56d2967
commit 3b58c61b33

View File

@@ -23,7 +23,7 @@ use std::sync::RwLock;
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
use log::{info, warn};
use log::{error, info, warn};
use postgres::{Client, NoTls};
use serde::{Serialize, Serializer};
@@ -311,8 +311,9 @@ impl ComputeNode {
.wait()
.expect("failed to start waiting on Postgres process");
self.check_for_core_dumps()
.expect("failed to check for core dumps");
if let Err(err) = self.check_for_core_dumps() {
error!("error while checking for core dumps: {err:?}");
}
Ok(ecode)
}