From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2C7DF1FF168 for ; Tue, 4 Feb 2025 10:56:28 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1D36F110CA; Tue, 4 Feb 2025 10:56:28 +0100 (CET) From: Wolfgang Bumiller To: pdm-devel@lists.proxmox.com Date: Tue, 4 Feb 2025 10:55:47 +0100 Message-Id: <20250204095554.39501-1-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.085 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lib.rs, proxmox-datacenter-api.rs, main.rs, mod.rs, connection.rs] Subject: [pdm-devel] [PATCH pdm 0/7] multi-remote client and node reachability cache X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" 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 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel