From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 0BB9A1FF0E0 for ; Thu, 23 Jul 2026 13:52:17 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 26E2B214B8; Thu, 23 Jul 2026 13:52:16 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH proxmox-backup v3 08/10] api/datastore: use maintenance-mode lock to protect against changes From: Robert Obkircher To: Christian Ebner In-Reply-To: <20260721103643.333028-9-c.ebner@proxmox.com> References: <20260721103643.333028-1-c.ebner@proxmox.com> <20260721103643.333028-9-c.ebner@proxmox.com> Date: Thu, 23 Jul 2026 13:52:10 +0200 Message-Id: <178480753020.88450.10399555870737928063.b4-review@b4> X-Mailer: b4 0.16-dev X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784807503142 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.194 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust 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: LIEPY3WBXJVZSKQJKZ5PW27LM3T7K4QO X-Message-ID-Hash: LIEPY3WBXJVZSKQJKZ5PW27LM3T7K4QO X-MailFrom: r.obkircher@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 CC: pbs-devel@lists.proxmox.com 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: > The bucket access check performed when creating a new datastore with > s3 backend can theoretically block up to the set s3 client request > timeout of 30 min. It is not acceptable to hold the config lock for > this long, effectively blocking configuration access for unrelated > datastores. > > Move the check to the start so it is performed before even locking > the config. > > Signed-off-by: Christian Ebner > > diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs > index b3b6ed8c6..bbbd79ab0 100644 > --- a/src/api2/config/datastore.rs > +++ b/src/api2/config/datastore.rs > @@ -166,6 +166,13 @@ pub fn create_datastore( > overwrite_in_use: bool, > rpcenv: &mut dyn RpcEnvironment, > ) -> Result { > + let (backend, s3_client) = DataStore::s3_client_and_backend_from_datastore_config(&config)?; > + if let Some(s3_client) = s3_client { > + proxmox_async::runtime::block_on(s3_client.head_bucket()) > + .context("failed to access bucket") > + .map_err(|err| format_err!("{err:#}"))?; > + } > + This could now incremnt the request counters of an existing store, but that shold be ok and I didn't spot any other side effects. -- Robert Obkircher