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 6A8FC1FF137 for ; Tue, 31 Mar 2026 11:36:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AE0781619A; Tue, 31 Mar 2026 11:36:41 +0200 (CEST) Message-ID: Date: Tue, 31 Mar 2026 11:36:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup v6 18/22] datastore: add thresholds notification callback on datastore lookup To: Christian Ebner , pbs-devel@lists.proxmox.com References: <20260319094100.240765-1-c.ebner@proxmox.com> <20260319094100.240765-31-c.ebner@proxmox.com> Content-Language: en-US From: Hannes Laimer In-Reply-To: <20260319094100.240765-31-c.ebner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774949743165 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.082 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: K5X6DVD2LP6CFQLWCXXOJ6DFYHUOCL74 X-Message-ID-Hash: K5X6DVD2LP6CFQLWCXXOJ6DFYHUOCL74 X-MailFrom: h.laimer@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: On 2026-03-19 10:41, Christian Ebner wrote: > Pass in the callback to be executed when a datastore threshold value > exceeds its set limit. This callback is then callable by the s3 > client request counters implementation, currently the only component > defining thresholds. > > When a threshold is exceeded, the notification is generated by the > callback and queued for being send. > > Signed-off-by: Christian Ebner > --- [..] > +pub type ThresholdsExceededCallback = fn(&str, &str, u64, u64) -> Result<(), Error>; > + > pub struct DataStoreLookup<'a> { > name: &'a str, > operation: Operation, > + thresholds_exceeded_callback: Arc>, fn pointers are `Copy + Send + Sync + 'static`, so we don't need an `Arc` here > } > > impl<'a> DataStoreLookup<'a> { > - pub fn with(name: &'a str, operation: Operation) -> Self { > - Self { name, operation } > + pub fn with( > + name: &'a str, > + operation: Operation, > + thresholds_exceeded_callback: Arc>, > + ) -> Self { > + Self { > + name, > + operation, > + thresholds_exceeded_callback, > + } > } > } [..]