From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id BF8A71FF16F for ; Tue, 14 Oct 2025 09:55:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 89F4622283; Tue, 14 Oct 2025 09:56:01 +0200 (CEST) From: Hannes Laimer To: pbs-devel@lists.proxmox.com Date: Tue, 14 Oct 2025 09:55:45 +0200 Message-ID: <20251014075545.20528-1-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760428520795 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.044 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" `lookup_datastore` fails if a removable datastore is not mounted, which is fine. But for job scheduling which happens every minute we don't want the lookup to fail and fill the syslogs with unnecesarry entries, so we check the mount status before we do the lookup to avoid that. Reported-by: https://forum.proxmox.com/threads/sicherung-auf-usb.167291/post-808237 Signed-off-by: Hannes Laimer --- src/bin/proxmox-backup-proxy.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index cfd93f92..762b5736 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -22,7 +22,7 @@ use proxmox_router::{RpcEnvironment, RpcEnvironmentType}; use proxmox_sys::fs::CreateOptions; use proxmox_sys::logrotate::LogRotate; -use pbs_datastore::DataStore; +use pbs_datastore::{DataStore, get_datastore_mount_status}; use proxmox_rest_server::{ cleanup_old_tasks, cookie_from_header, rotate_task_log_archive, ApiConfig, Redirector, @@ -516,7 +516,7 @@ async fn schedule_datastore_garbage_collection() { } }; - let event_str = match store_config.gc_schedule { + let event_str = match store_config.gc_schedule.as_ref() { Some(event_str) => event_str, None => continue, }; @@ -530,6 +530,12 @@ async fn schedule_datastore_garbage_collection() { }; { + if let Some(false) = get_datastore_mount_status(&store_config) { + // lookup_datastore would fail correctly, but we don't want log entries every + // minute for a not mounted removable datastore + continue; + } + // limit datastore scope due to Op::Lookup let datastore = match DataStore::lookup_datastore(&store, Some(Operation::Lookup)) { Ok(datastore) => datastore, @@ -588,7 +594,7 @@ async fn schedule_datastore_garbage_collection() { job, datastore, auth_id, - Some(event_str), + Some(event_str.into()), false, ) { eprintln!("unable to start garbage collection job on datastore {store} - {err:#}"); -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel