Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entries never expires on dns cache #2063

Closed
bodji opened this issue Sep 10, 2019 · 7 comments
Closed

Entries never expires on dns cache #2063

bodji opened this issue Sep 10, 2019 · 7 comments
Labels

Comments

@bodji
Copy link

bodji commented Sep 10, 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

@bodji
Copy link
Author

bodji commented Sep 11, 2019

Little update :

  • The problem happens at startup.
  • The consequence : get_ticks_raw() returns always the same value (set at startup)

So it seems that, sometimes, Kamailio won't boot up
correctly, and the timers are not working properly.

We keep digging to try to find why.

Kind regards,
Mathieu Bodjikian

@miconda
Copy link
Member

miconda commented Sep 13, 2019

Can you get the output of kamctl trap when the issue is exposed? If the timer doesn't work properly, then a lot of other components should be affected.

@bodji
Copy link
Author

bodji commented Sep 13, 2019

Hello,

I think we found the bug.

It is related to the libssl 1.1 mutex issue.

We load our LCR rules from a postgres server using TLS connection and I think the mtree module got stuck.

We are trying the custom library « openssl_mutex_shared » in the TLS directory and preload it before starting kamailio.

For now it seems that we do not have freezes anymore, I’ll close issue beginning of next week we do not have anymore issue during week-end.

This issue is creating wild and random consequences ! What is the status of this regarding libressl development team ?

Kind regards,
Mathieu Bodjikian

@henningw
Copy link
Contributor

Interesting - I think we also had reports related to this for the db_mysql module with a similar issue.
Today the workaround related to the libssl 1.1 problem was added to the 5.3-pre version core. It will be also backported to the stable branches after a testing period.

@henningw henningw added the bug label Sep 13, 2019
@henningw
Copy link
Contributor

@bodji How does it works out for you, can this be closed? About the question related to the libressl team, I am not aware of any news here. For 5.3.0(-pre) the library workaround have been added to the core.

@bodji
Copy link
Author

bodji commented Sep 24, 2019

Hello,

Yes, all is working fine either with the openssl_mutex_shared.so
preload at start or the next 5.3.0 release.

I close the issue.

Thanks !

@bodji bodji closed this as completed Sep 24, 2019
@miconda
Copy link
Member

miconda commented Sep 24, 2019

Thanks for feedback, I am going to backport to stable branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants