mirror of
https://github.com/mailscope/kumomta.git
synced 2026-10-30 10:06:52 +00:00
fix: total_connections_denied{service="esmtp_listener"} always reaped
This is an regression introduced by the recent changes to support reloading tls parameters in the esmtp listener. We need to ensure that the counter is kept alive for the duration of the listener so that it doesn't get immediately repead out of the reported set of metrics.
This commit is contained in:
@@ -473,7 +473,7 @@ impl EsmtpListenerParams {
|
||||
}
|
||||
|
||||
pub async fn run(self) -> anyhow::Result<()> {
|
||||
connection_gauge();
|
||||
let connection_gauge = connection_gauge();
|
||||
|
||||
let listener = TcpListener::bind(&self.listen)
|
||||
.await
|
||||
@@ -490,6 +490,10 @@ impl EsmtpListenerParams {
|
||||
tokio::select! {
|
||||
_ = shutting_down.shutting_down() => {
|
||||
tracing::info!("smtp listener on {addr:?} -> stopping");
|
||||
// Keep the connection gauge alive for the lifetime
|
||||
// of this listener so that it doesn't get reaped out
|
||||
// of the reported set of metrics
|
||||
drop(connection_gauge);
|
||||
return Ok::<(), anyhow::Error>(());
|
||||
}
|
||||
result = listener.accept() => {
|
||||
|
||||
Reference in New Issue
Block a user