[ opensips-Patches-2969454 ] atomic registration handling

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ opensips-Patches-2969454 ] atomic registration handling

SourceForge.net
Patches item #2969454, was opened at 2010-03-12 16:09
Message generated for change (Tracker Item Submitted) made by viraptor
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: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stanislaw Pitucha (viraptor)
Assigned to: Nobody/Anonymous (nobody)
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.

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

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

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel