<p></p>
<p>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:</p>
<ul>
<li><a href="https://www.kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.rm_expired_delay" rel="nofollow">https://www.kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.rm_expired_delay</a></li>
</ul>
<p>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.</p>
<p>If you need to discuss further, then join <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>, 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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2455#issuecomment-679222649">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZN45I55E5I76LST7PDSCKGJJANCNFSM4QJO2OBA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZO66L4N6SYT5ASNI4LSCKGJJA5CNFSM4QJO2OBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFB6B26I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2455#issuecomment-679222649",
"url": "https://github.com/kamailio/kamailio/issues/2455#issuecomment-679222649",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>