From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 16F9B1FF13F for ; Thu, 29 Jan 2026 13:26:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2BD4B17DD; Thu, 29 Jan 2026 13:27:22 +0100 (CET) From: Christian Ebner 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 Message-ID: <20260129122700.448448-4-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260129122700.448448-1-c.ebner@proxmox.com> References: <20260129122700.448448-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769689566519 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.048 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: HIXIYXV6IQDEEONZCCYLACK2AFXTNHK3 X-Message-ID-Hash: HIXIYXV6IQDEEONZCCYLACK2AFXTNHK3 X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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