[pbs-devel] [PATCH proxmox-backup 1/2] datastore: gc: drop mutex lock before entering async context
Christian Ebner
c.ebner at proxmox.com
Thu Oct 2 11:11:41 CEST 2025
The list of objects to be deleted from the S3 backend is already
generated at this point, so no need to hold the lock any longer.
Avoids holding the lock while entering an async context, which
can lead to deadlocks when held across await boundaries.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
pbs-datastore/src/datastore.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 8d6aea9d1..2e62590f9 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -1670,6 +1670,8 @@ impl DataStore {
}
}
+ drop(lock);
+
if !delete_list.is_empty() {
let delete_objects_result =
proxmox_async::runtime::block_on(s3_client.delete_objects(&delete_list))?;
@@ -1679,8 +1681,6 @@ impl DataStore {
delete_list.clear();
}
- drop(lock);
-
// Process next batch of chunks if there is more
if list_bucket_result.is_truncated {
list_bucket_result =
--
2.47.3
More information about the pbs-devel
mailing list