[OpenSIPS-Devel] [ opensips-Patches-2969454 ] atomic registration handling

SourceForge.net noreply at sourceforge.net
Sun Aug 1 23:15:20 CEST 2010


Patches item #2969454, was opened at 2010-03-12 17:09
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2969454&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
>Group: 1.6.x
Status: Open
Resolution: None
>Priority: 7
Private: No
Submitted By: Stanislaw Pitucha (viraptor)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: atomic registration handling

Initial Comment:
Hi
Here's a patch we've been using since ~1.3.X and ported until 1.6.X. It seems stable, although some of the functionality was ported by copy-pasting and might need a review (I did not know much about opensips when I wrote it!)

Basically it allows setting db_atomic=1 if you're already using realtime database and will eliminate a race condition when doing re-registration. During normal operation, it's possible that opensips does:

SELECT .... FROM location (checking existing ones)
DELETE FROM location WHERE (timer cleaning up the existing registration)
UPDATE location SET ... (trying to update registration that doesn't exist anymore)

We've had problems with people getting randomly deregistered and after patching we didn't get any more complaints. Using db_atomic=1 requires a database schema change. Depending on whether you use domains or not, you need:
UNIQUE KEY `registration_idx` (`username`,`contact`)
or
UNIQUE KEY `registration_idx` (`username`,`domain`,`contact`)
in the location table.

This is a patch against 1.6.1.

----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-08-02 00:15

Message:
Hi Stan,

Thanks for the patch - I will review it asap and uploaded it on SVN.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2969454&group_id=232389



More information about the Devel mailing list