[asterisk-dev] [Code Review] 4338: res_pjsip_outbound_registration: Fix race condition with executing "pjsip show registrations" and reloading.

rmudgett reviewboard at asterisk.org
Wed Jan 14 13:52:39 CST 2015


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

Ship it!


Fixing the crash is good.

A minor consequence of exiting early is now when there is no state to go with the previous configuration, the container could be non-empty but not print anything.  The ast_sip_cli_traverse_objects() would then not notify the user about "No objects found."

- rmudgett


On Jan. 14, 2015, 1:28 p.m., Joshua Colp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4338/
> -----------------------------------------------------------
> 
> (Updated Jan. 14, 2015, 1:28 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> There exists a race condition with executing "pjsip show registrations" and reloading. This came to exist due to the splitting up of state information and configuration. Previously there was a guarantee that if you had the configuration you would also have the state. This is no longer true. When the "pjsip show registrations" CLI command is executed it grabs a container of the registration configuration at that point in time. It does NOT grab the state at that time. As each registration configuration is printed the underlying state can change or go away completely. The code in "pjsip show registrations" which printed out the information did not take this into account. It now does.
> 
> If an outbound registration is being printed but no state exists it is now skipped.
> 
> 
> Diffs
> -----
> 
>   /branches/13/res/res_pjsip_outbound_registration.c 430588 
> 
> Diff: https://reviewboard.asterisk.org/r/4338/diff/
> 
> 
> Testing
> -------
> 
> Ran show registrations and reloads over and over, still happy. Without patch this would sometimes crash.
> 
> 
> Thanks,
> 
> Joshua Colp
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150114/0c92e984/attachment.html>


More information about the asterisk-dev mailing list