From e442a69fc134e6f1ebd72b6f3d2513b21106da30 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 26 Jan 2024 01:44:27 +0100 Subject: [PATCH] cluster: try make the cluster socket high-priority The heartbeat messages, notably, should really not be lost, otherwise the cluster will dismantle itself if some very-high trafic is filling packet queues. --- cluster.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cluster.c b/cluster.c index 2ebe4b3..d68918a 100644 --- a/cluster.c +++ b/cluster.c @@ -133,6 +133,9 @@ int cluster_init() opt = 0; // Turn off multicast loopback. setsockopt(cluster_sockfd, IPPROTO_IP, IP_MULTICAST_LOOP, &opt, sizeof(opt)); + opt = 7; // Highest priority to avoid getting hit by high-traffic + setsockopt(cluster_sockfd, SOL_SOCKET, SO_PRIORITY, &opt, sizeof(opt)); + if (config->cluster_mcast_ttl != 1) { uint8_t ttl = 0;