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.
This commit is contained in:
Samuel Thibault 2024-01-26 01:44:27 +01:00
parent 878e9dd88a
commit e442a69fc1

View file

@ -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;