feat(cluster): move member info sync to UDP heartbeat; remove HTTP polling

Broadcast CLUSTER_HEARTBEAT every 5s; peers reply with CLUSTER_NODE_INFO containing resources and labels. Update memberList from received node info and set status/lastSeen; keep UDP discovery responses.

Disable HTTP-based updateAllMembersInfoTaskCallback loop to reduce network and memory overhead.

Add protocol constants HEARTBEAT_MSG and NODE_INFO_MSG; increase UDP buffer to 512 bytes.

Set default heartbeat_interval_ms to 5000 ms.

Fix sdkVersion JSON fallback by converting to const char* before assigning to String.
This commit is contained in:
2025-09-23 22:11:49 +02:00
parent c11652c123
commit 921e2c7152
3 changed files with 95 additions and 24 deletions

View File

@@ -7,8 +7,11 @@
namespace ClusterProtocol {
constexpr const char* DISCOVERY_MSG = "CLUSTER_DISCOVERY";
constexpr const char* RESPONSE_MSG = "CLUSTER_RESPONSE";
constexpr const char* HEARTBEAT_MSG = "CLUSTER_HEARTBEAT";
constexpr const char* NODE_INFO_MSG = "CLUSTER_NODE_INFO";
constexpr uint16_t UDP_PORT = 4210;
constexpr size_t UDP_BUF_SIZE = 64;
// Increased buffer to accommodate node info JSON over UDP
constexpr size_t UDP_BUF_SIZE = 512;
constexpr const char* API_NODE_STATUS = "/api/node/status";
}