[asterisk-dev] [Code Review] 4390: app_agent_pool: Fix initial module load agent device state reporting.
Joshua Colp
reviewboard at asterisk.org
Fri Jan 30 07:01:30 CST 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4390/#review14388
-----------------------------------------------------------
Ship it!
Ship It!
- Joshua Colp
On Jan. 29, 2015, 10:31 p.m., rmudgett wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4390/
> -----------------------------------------------------------
>
> (Updated Jan. 29, 2015, 10:31 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-24737
> https://issues.asterisk.org/jira/browse/ASTERISK-24737
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> When the app_agent_pool module initially loads there is a race condition
> between the thread loading agents.conf and the device state internal
> processing thread. If the device state internal processing thread handles
> the agent creation state updates before the thread that loaded agents.conf
> registers the device state provider callback then the cached agent state
> is "Invalid". When a consumer module like app_queue asks for the agent state
> it gets the cached "Invalid" state instead of the real state from the provider.
>
> * Moved loading the agents.conf configuration to the last thing setup by
> app_agent_pool in load_module(). Now the device state provider callback
> is registered before the config is loaded so the agent creation state
> updates are guaranteed to get the initial device state.
>
> * Removed some now redundant config cleanup on error in load_config().
>
> * Added lock protection when accessing the device state in
> agent_pvt_devstate_get() and eliminated the RAII_VAR() usage.
>
>
> Diffs
> -----
>
> /branches/13/apps/app_agent_pool.c 431427
>
> Diff: https://reviewboard.asterisk.org/r/4390/diff/
>
>
> Testing
> -------
>
> Without the patch, the initial agent state reported by app_queue is "Invalid".
> With the patch, the initial agent state reported by app_queue is the expected "Unavailable" state.
>
>
> Thanks,
>
> rmudgett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150130/49c77f44/attachment.html>
More information about the asterisk-dev
mailing list