[asterisk-dev] [Code Review] 2860: pjsip: race condition in registrar

Kevin Harwell reviewboard at asterisk.org
Wed Sep 18 14:04:01 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2860/
-----------------------------------------------------------

(Updated Sept. 18, 2013, 7:04 p.m.)


Review request for Asterisk Developers, Joshua Colp and Mark Michelson.


Changes
-------

Addressed review findings.  Also tested as suggested using a second Asterisk server with multiple registration lines.


Bugs: AST-1213
    https://issues.asterisk.org/jira/browse/AST-1213


Repository: Asterisk


Description
-------

While handling a registration request a race condition could occur if/when two+ clients registered at the same time.  This happened when one request obtained a copy of the current contacts for an AOR and another request did the same before the first request updated.  Thus the second would update and overwrite the first (or vice-versa depending on which actually updated first).  In the case of it being the same contact two "add" events would be raised.

pjsip registration handling is now serialized to alleviate this issue.


Diffs (updated)
-----

  branches/12/res/res_pjsip_registrar.c 399392 

Diff: https://reviewboard.asterisk.org/r/2860/diff/


Testing
-------

Had a few phones register themselves with asterisk using pjsip registration.  Also ran all the pjsip registration testsuite tests and made sure they all passed.


Thanks,

Kevin Harwell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130918/e2c68549/attachment-0001.htm>


More information about the asterisk-dev mailing list