[asterisk-dev] [Code Review] Provide means to notify manager sessions that all modules have finished loading
Russell Bryant
russell at digium.com
Sat May 1 15:35:08 CDT 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/639/#review1945
-----------------------------------------------------------
Can you think of a reason why we shouldn't just not accept AMI connections until Asterisk is fully loaded?
- Russell
On 2010-05-01 01:35:28, Terry Wilson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/639/
> -----------------------------------------------------------
>
> (Updated 2010-05-01 01:35:28)
>
>
> Review request for Asterisk Developers and Russell Bryant.
>
>
> Summary
> -------
>
> It is possible to connect to Asterisk via the manager interface before all of the modules are finished loading. This can lead to manager actions failing because a necessary module hasn't loaded yet. One area where this is really annoying is when writing external tests.
>
> This small patch adds a FullyBooted manager event which fires when Asterisk is finished loading the modules. Since it is possible that one would miss this event, it is also sent upon login if Asterisk is fully booted.
>
> I also propose that we add this to all branches to aid in testing. For existing releases, I think it should be disabled by default and enabled via an asterisk.conf setting to avoid any behavior changes.
>
> In the very unlikely event that someone successfully authenticates between setting of AST_OPT_FLAG_FULLY_BOOTED and the sending of the manager_event in asterisk.c, they would get two FullyBooted events. Personally, I'm Ok with that since we really only care whether or not Asterisk is fully booted or not. I can't think of any circumstances where we could actually miss a FullyBooted event, though, which is the important thing. If we need to bother with locking, we can do that too of course. :-)
>
>
> Diffs
> -----
>
> /trunk/main/asterisk.c 260520
> /trunk/main/manager.c 260520
>
> Diff: https://reviewboard.asterisk.org/r/639/diff
>
>
> Testing
> -------
>
> Connected and verified that the Event fires (and that a well placed sleep() makes it fire twice).
>
>
> Thanks,
>
> Terry
>
>
More information about the asterisk-dev
mailing list