public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Christian Ebner <c.ebner@proxmox.com>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup v8 02/10] tools: implement buffered logger for concurrent log messages
Date: Wed, 22 Apr 2026 19:25:04 +0200	[thread overview]
Message-ID: <65e4afed-1561-4b27-b44b-ed72678feb15@proxmox.com> (raw)
In-Reply-To: <20260422131820.769620-3-c.ebner@proxmox.com>

Am 22.04.26 um 15:17 schrieb Christian Ebner:
> The BufferedLogger instance collects messages send from different
> sender instances via an async tokio channel and buffers them. Sender
> identify by label and provide a log level for each log line to be
> buffered and flushed.
> 
> On collection, log lines are grouped by label and buffered in
> sequence of arrival per label, up to the configured maximum number of
> per group lines. In addition, the last logged timestamp is updated,
> which will be used to periodically flush log lines per-label with the
> configured interval. There is no guarantee on the order of labels when
> flushing.
> 
> In addition, senders can request flushing at any given point, all logs
> are flushed when closing the sender builder.
> 
> Log output is written based on provided log line level and prefixed
> by the label.
>
> Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
>  pbs-tools/Cargo.toml             |   3 +
>  pbs-tools/src/buffered_logger.rs | 238 +++++++++++++++++++++++++++++++
>  pbs-tools/src/lib.rs             |   1 +
>  3 files changed, 242 insertions(+)
>  create mode 100644 pbs-tools/src/buffered_logger.rs
> 
> diff --git a/pbs-tools/Cargo.toml b/pbs-tools/Cargo.toml
> index 998e3077e..8bc01e85d 100644
> --- a/pbs-tools/Cargo.toml
> +++ b/pbs-tools/Cargo.toml
> @@ -8,6 +8,7 @@ description = "common tools used throughout pbs"
>  # This must not depend on any subcrates more closely related to pbs itself.
>  [dependencies]
>  anyhow.workspace = true
> +async-trait.workspace = true
>  bytes.workspace = true
>  foreign-types.workspace = true
>  hex.workspace = true
> @@ -17,10 +18,12 @@ openssl.workspace = true
>  serde_json.workspace = true
>  # rt-multi-thread is required for block_in_place
>  tokio = { workspace = true, features = [ "fs", "io-util", "rt", "rt-multi-thread", "sync" ] }
> +tracing.workspace = true
>  
>  proxmox-async.workspace = true
>  proxmox-io = { workspace = true, features = [ "tokio" ] }
>  proxmox-human-byte.workspace = true
> +proxmox-log.workspace = true
>  proxmox-sys.workspace = true
>  proxmox-time.workspace = true
>  
> diff --git a/pbs-tools/src/buffered_logger.rs b/pbs-tools/src/buffered_logger.rs
> new file mode 100644
> index 000000000..4e9bf8651
> --- /dev/null
> +++ b/pbs-tools/src/buffered_logger.rs
> @@ -0,0 +1,238 @@
> +//! Log aggregator to collect and group messages sent from concurrent tasks via
> +//! a tokio channel.

fine for now to introduce this here, especially given the lower friction
for fixes and improvements, which are also more likely to happen initially,
but in the longer term this might be better of in it's own micro-crate or
proxmox-log as opt-in feature.

As while the pbs-tools workspace crate can be fine as staging ground and
maybe for some stuff that's very specific to PBS, but in general I'd like
to see most of it's (somewhat generic) code to move into the common
proxmox.git workspace in some form - existing crate or new (micro) crate.




  reply	other threads:[~2026-04-22 17:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 13:18 [PATCH proxmox{,-backup} v8 00/10] fix #4182: concurrent group pull/push support for sync jobs Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox v8 01/10] pbs api types: add `worker-threads` to sync job config Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 02/10] tools: implement buffered logger for concurrent log messages Christian Ebner
2026-04-22 17:25   ` Thomas Lamprecht [this message]
2026-04-22 13:18 ` [PATCH proxmox-backup v8 03/10] tools: add bounded join set to run concurrent tasks bound by limit Christian Ebner
2026-04-22 17:32   ` Thomas Lamprecht
2026-04-22 20:19     ` Thomas Lamprecht
2026-04-22 13:18 ` [PATCH proxmox-backup v8 04/10] api: config/sync: add optional `worker-threads` property Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 05/10] fix #4182: server: sync: allow pulling backup groups in parallel Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 06/10] server: pull: prefix log messages and add error context Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 07/10] server: sync: allow pushing groups concurrently Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 08/10] server: push: prefix log messages and add additional logging Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 09/10] sync: move in-progress snapshot filter to helper and use log line sender Christian Ebner
2026-04-22 13:18 ` [PATCH proxmox-backup v8 10/10] ui: expose group worker setting in sync job edit window Christian Ebner
2026-04-22 19:23 ` applied: [PATCH proxmox{,-backup} v8 00/10] fix #4182: concurrent group pull/push support for sync jobs Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65e4afed-1561-4b27-b44b-ed72678feb15@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal