@lbalaceanu commented on this pull request.


> @@ -141,6 +170,30 @@ static int mod_init(void)
                db_redis_hash_expires_str.len = snprintf(
                                db_redis_hash_expires_str.s, 20, "%d", 
db_redis_hash_expires);
        }
+
+       shared_time = shm_malloc(sizeof(time_t));

I consider we should use a shared mem value there because this is a value used 
by all Kamailio processes. Here is the background:

The timer is there for the "failover" cases when _use_replicas=1_ : when no 
Redis replica is reachable for some reason, for some process, Kamailio should 
try to connect, even for reading, to the Redis master (maybe this one is 
working). After some time, Kamailio should try to recheck the replica 
availability.

The thing is that we have multiple Redis connections and to different Redis 
replicas (each Kamailio receiver child holds a Redis connection of its own)

I implemented the recheck for replicas by using a "central timer" for ALL 
Kamailio processes and then only the processes interested 
(_using_master_read_only=1_) would look into this value. Possibly I should have 
implemented with a timer per proc - please advise or point me to some code 
example.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4373#discussion_r2444184528
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4373/review/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to