Re: [PATCH proxmox-backup v8 03/10] tools: add bounded join set to run concurrent tasks bound by limit

Thomas Lamprecht
2026-04-22T17:33:08Z

Am 22.04.26 um 15:17 schrieb Christian Ebner:
> The BoundedJoinSet allows to run tasks concurrently via a JoinSet,
> but constrains the number of concurrent tasks by an upper limit.
>
> In contrast to the ParallelHandler implementation, which is a purely
> sync implementation and does not provide easy handling for returned
> results, this allows to execute tasks in an async context with straight
> forward handling of results, as required for e.g. pulling/pushing of
> backup groups in parallel for sync jobs. Also, log context is easily
> preserved, which is of importance for task logging.
>
> Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> pbs-tools/src/bounded_join_set.rs | 81 +++++++++++++++++++++++++++++++
> pbs-tools/src/lib.rs | 1 +
> 2 files changed, 82 insertions(+)
> create mode 100644 pbs-tools/src/bounded_join_set.rs
>
> diff --git a/pbs-tools/src/bounded_join_set.rs b/pbs-tools/src/bounded_join_set.rs
> new file mode 100644
> index 000000000..07500c66b
> --- /dev/null
> +++ b/pbs-tools/src/bounded_join_set.rs
> @@ -0,0 +1,81 @@
> +//! JoinSet with an upper bound of concurrent tasks.
> +//!
> +//! Allows to run up to the configured number of tasks concurrently in an async
> +//! context.

similar to my reply to the buffered log module: Might be nicer if this lives
in the proxmox rust workspace, and in fact Lukas factored out the
parallel-handler recently into its own crate, depending on the semantic and
dependency overlap this might also go into the newish proxmox-parallel-handler
crate or its own nano crate.

But fine for now to be here, no need for another revision.