mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 18:02:56 +00:00
pageserver: log on potentially stuck connection manager loop
This commit is contained in:
@@ -107,6 +107,8 @@ pub(super) async fn connection_manager_loop_step(
|
||||
let mut broker_subscription = subscribe_for_timeline_updates(broker_client, id, cancel).await?;
|
||||
debug!("Subscribed for broker timeline updates");
|
||||
|
||||
const WARN_ON_INACTIVE_AFTER: Duration = Duration::from_secs(60);
|
||||
|
||||
loop {
|
||||
let time_until_next_retry = connection_manager_state.time_until_next_retry();
|
||||
let any_activity = connection_manager_state.wal_connection.is_some()
|
||||
@@ -287,6 +289,15 @@ pub(super) async fn connection_manager_loop_step(
|
||||
let _ = broker_client.publish_one(msg).await;
|
||||
debug!("Discovery request sent to the broker");
|
||||
None
|
||||
} => {},
|
||||
// Observability arm: if there's no active connection and we've received no inputs
|
||||
// for a long while, then the loop might be stuck.
|
||||
Some(()) = async {
|
||||
if !any_activity {
|
||||
tokio::time::sleep(WARN_ON_INACTIVE_AFTER).await;
|
||||
tracing::warn!("Connection is inactive and received no inputs for a long time");
|
||||
}
|
||||
None
|
||||
} => {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user