[pdm-devel] [PATCH pdm 0/7] multi-remote client and node reachability cache
Wolfgang Bumiller
w.bumiller at proxmox.com
Tue Feb 4 10:55:47 CET 2025
This consists of two parts (and a question (at the end)):
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...
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 | 635 ++++++++++++++++--
server/src/lib.rs | 1 +
server/src/remote_cache/mod.rs | 291 ++++++++
8 files changed, 1140 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
--
2.39.5
More information about the pdm-devel
mailing list