[pdm-devel] applied-series: [PATCH pdm 0/7] multi-remote client and node reachability cache
Thomas Lamprecht
t.lamprecht at proxmox.com
Sun Mar 16 22:39:17 CET 2025
On 05/03/2025 16:01, Wolfgang Bumiller wrote:
> This consists of two functional parts and a tracing patch at the end.
>
> Excerpt of the original cover letter:
>
> 1) Patches 1 through 3:
> The `MultiClient` which implements cycling through multiple remotes
> when requests fail due to network issues.
>
> 2) Patches 4 through 6:
> A task caching the remote reachability state as well as mapping
> hostnames to the pve-side node-names. Currently this simply runs every
> 60 seconds and goes through the current remotes+nodes and checks for
> reachability.
> If at that time the remote.cfg changed and the polling
> task is still ongoing it will be aborted and started over with the new
> config.
> Finally, the reachability information will be used and updated by the
> `MultiClient` implementation.
>
> 3) Patch 7 is mainly for debugging. I'm not sure whether we want to include
> tracing instrumentation in general, or via a `#[cfg_attr]` or only for
> debug builds...
> It would probably also be nice to implicitly `#[instrument]` all the api
> methods so we can follow along a trace from a specific api method.
> (Currently I did this only temporarily without committing anything by
> attaching, for example, a `#[instrument(name =
> "api_method_list_nodes")]` attribute to the `list_nodes` api call to
> more easily see the client usage via `journalctl -f
> SPAN_NAME=api_method_list_nodes` on the shell...
>
> Changes since v1:
> Only patch 1 is changed to include error messages from the last tried
> client are also logged as noted by Lukas.
>
> Wolfgang Bumiller (7):
> server: generic multi-client wrapper
> server: store pve MultiClient for re-use
> server: separate ConnectInfo from client creation
> server: cache pve node reachability and names
> server: don't try to connect to known-unreachable servers
> server: try previously unreachable clients as last resort
> server: add some tracing instrumentation
>
> lib/pdm-config/src/config_version_cache.rs | 33 +-
> server/src/api/pve/mod.rs | 20 +-
> .../main.rs} | 3 +
> .../bin/proxmox-datacenter-api/tasks/mod.rs | 1 +
> .../tasks/remote_node_mapping.rs | 228 +++++++
> server/src/connection.rs | 641 ++++++++++++++++--
> server/src/lib.rs | 1 +
> server/src/remote_cache/mod.rs | 291 ++++++++
> 8 files changed, 1146 insertions(+), 72 deletions(-)
> rename server/src/bin/{proxmox-datacenter-api.rs => proxmox-datacenter-api/main.rs} (99%)
> create mode 100644 server/src/bin/proxmox-datacenter-api/tasks/mod.rs
> create mode 100644 server/src/bin/proxmox-datacenter-api/tasks/remote_node_mapping.rs
> create mode 100644 server/src/remote_cache/mod.rs
>
applied series, thanks!
More information about the pdm-devel
mailing list