[sr-dev] [kamailio/kamailio] Usrloc race condition when db_mode is set to 2 (#2455)

Daniel-Constantin Mierla notifications at github.com
Mon Aug 24 18:11:00 CEST 2020


The delete is from timer process, independent of processing REGISTER requests that are handled in another processes. If you need some delay when removing contact for db_mode=2, look at the parameter:

  * https://www.kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.rm_expired_delay

Otherwise, adding locking/syncronization will introduce a bottleneck, decreasing the performances. And overall, even it would be serialized, I think it is better to do delete first, so the insert/update is going to be faster, not having key constraints checking on invalid records. Even more, the phones usually have to re-register several seconds before expiration of their last registration, otherwise network transmission can add delay and the old record is removed anyhow, typically is 20-30sec before expiration when the expire value is at least a few minutes. In your case, it seems it is 1 minute.

If you need to discuss further, then join sr-users at lists.kamailio.org, there are a lot of options that allows tuning usrloc for specific use cases. Here we track bugs in the C code and for now look more like a design decision than a bug. If proves to be a bug after discussions, then it can be reopened.

-- 
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/2455#issuecomment-679222649
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200824/4fd01acd/attachment.htm>


More information about the sr-dev mailing list