[sr-dev] [kamailio/kamailio] Entries never expires on dns cache (#2063)

Mathieu Bodjikian notifications at github.com
Tue Sep 10 17:31:10 CEST 2019


Hello,

We have a weird bug in our Kamailio boxes.

We use the DNS cache (for dns failover to work properly), and on some servers, the cache becomes broken after some time.

The expire value is stuck and do not decrement over time, 
on the entry and on the records : 
`
kamcmd> dns.lookup A freeswitch
{
	name: freeswitch
	type: A
	size_bytes: 200
	reference_counter: 2
	permanent: no
	expires: 2
	last_used: 0
	negative_entry: no
	records: {
		{
			rr_idx: 0
			rr_ip: 10.0.0.1
			rr_permanent: no
			rr_expires: 2
		}
		{
			rr_idx: 1
			rr_ip: 10.0.0.2
			rr_permanent: no
			rr_expires: 2
		}
		{
			rr_idx: 2
			rr_ip: 10.0.0.3
			rr_permanent: no
			rr_expires: 2
		}
	}
}
`

Expires values are computed each time like this : 
`
now=get_ticks_raw();
expires = (s_ticks_t)(e->expire-now)<0?-1: TICKS_TO_S(e->expire-now);
`

So it would means either : 
- TICKS_TO_S(get_ticks_raw()) == 0 when the entry is created
- TICKS_TO_S(get_ticks_raw()) == 0 when the value is printed when we execute a dns.lookup through rpc.


Details : 
  - Kamailio : 5.2.4 (x86_64/linux)
  - OS : Debian 9.9
  - Running in Docker on Kubernetes cluster

I cannot say how to reproduce, it happens sometimes after running the binary :/

Do you have any idea ?


Kind regards,
Mathieu Bodjikian


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2063
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190910/d84b6b01/attachment.html>


More information about the sr-dev mailing list