public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 2/2] api: h2service: avoid logging heartbeat requests to task log
Date: Thu, 29 Jan 2026 13:27:00 +0100	[thread overview]
Message-ID: <20260129122700.448448-4-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260129122700.448448-1-c.ebner@proxmox.com>

Heartbeat requests can happen with a frequency as high as 1/s, adding
individual lines to the task log.

Use the http2 service filter function to exclude these request from
being logged by matching method and path accordingly.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 src/api2/backup/mod.rs |  2 +-
 src/api2/reader/mod.rs | 13 +++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/api2/backup/mod.rs b/src/api2/backup/mod.rs
index 3e6b7a950..3f32759ad 100644
--- a/src/api2/backup/mod.rs
+++ b/src/api2/backup/mod.rs
@@ -240,7 +240,7 @@ fn upgrade_to_backup_protocol(
                 ));
 
                 let service =
-                    H2Service::new(env.clone(), worker.clone(), &BACKUP_API_ROUTER, debug);
+                    H2Service::new(env.clone(), worker.clone(), &BACKUP_API_ROUTER, debug, None);
 
                 let abort_future = worker.abort_future();
 
diff --git a/src/api2/reader/mod.rs b/src/api2/reader/mod.rs
index 1c673d7a6..562e1f3f6 100644
--- a/src/api2/reader/mod.rs
+++ b/src/api2/reader/mod.rs
@@ -172,8 +172,13 @@ fn upgrade_to_backup_reader_protocol(
                     "starting new backup reader datastore '{store}': {path:?}"
                 ));
 
-                let service =
-                    H2Service::new(env.clone(), worker.clone(), &READER_API_ROUTER, debug);
+                let service = H2Service::new(
+                    env.clone(),
+                    worker.clone(),
+                    &READER_API_ROUTER,
+                    debug,
+                    Some(heartbeat_request_filter),
+                );
 
                 let mut abort_future = worker
                     .abort_future()
@@ -440,3 +445,7 @@ fn speedtest(
 pub async fn heartbeat(_rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> {
     Ok(())
 }
+
+fn heartbeat_request_filter(method: &hyper::Method, path: &str) -> bool {
+    method == hyper::Method::GET && path == "/heartbeat"
+}
-- 
2.47.3





      parent reply	other threads:[~2026-01-29 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 12:26 [RFC proxmox{,-backup} 0/3] fix #6373: HTTP level keepalive for http2 backup reader connection Christian Ebner
2026-01-29 12:26 ` [PATCH proxmox 1/1] rest-server: add request logfilter by method and path in h2 service Christian Ebner
2026-01-29 12:26 ` [PATCH proxmox-backup 1/2] fix #6373: HTTP level reader heartbeat for proxy connection keepalive Christian Ebner
2026-01-29 12:27 ` Christian Ebner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260129122700.448448-4-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal