Hi @lbalaceanu: Sorry for late answer, but I did not have time to test it earlier.
I compiled kamailio with your commit. kamailio -v version: kamailio 5.5.0-dev4 (x86_64/linux)
It seems to be ok now! It loads again in 18 seconds. Same DB and Data. For crosschecking I compiled 5.0.3 and 5.0.4 on the same machine: - 5.0.3 -> 18s - 5.0.4 -> 19min - 5.5.0-dev4 -> 18s
Your fix seems to help. I did not perform any further tests.
Thanks to all for your work on kamailio project!