[asterisk-dev] [Code Review] 4399: HTTP: Stop accepting requests on final system shutdown.
rmudgett
reviewboard at asterisk.org
Tue Feb 3 14:07:14 CST 2015
> On Feb. 3, 2015, 1:43 p.m., Matt Jordan wrote:
> > /branches/13/main/http.c, line 1877
> > <https://reviewboard.asterisk.org/r/4399/diff/1/?file=71251#file71251line1877>
> >
> > I'd change this to a 503 Service Unavailable. If you hit this, the HTTP server is unavailable (but still running), and may come back up.
> >
> > Granted, it may not, but we have to assume that the user plans on bringing Asterisk back up eventually...
> >
That's a better response. I didn't really like the 500 error code for this.
> On Feb. 3, 2015, 1:43 p.m., Matt Jordan wrote:
> > /branches/13/main/asterisk.c, line 2022
> > <https://reviewboard.asterisk.org/r/4399/diff/1/?file=71249#file71249line2022>
> >
> > It looks like you will double lock safe_system_lock here with the lock on line 1989.
Nope. The lock is released before the "No more Mr. Nice guy..." comment on line 2000.
- rmudgett
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4399/#review14402
-----------------------------------------------------------
On Feb. 2, 2015, 6:21 p.m., rmudgett wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4399/
> -----------------------------------------------------------
>
> (Updated Feb. 2, 2015, 6:21 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-24752
> https://issues.asterisk.org/jira/browse/ASTERISK-24752
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> There are three CLI commands to stop and restart Asterisk each.
>
> 1) core stop/restart now - Hangup all calls and stop or restart Asterisk.
>
> 2) core stop/restart gracefully - Stop or restart Asterisk when there are
> no calls in the system. New channels are prevented while the shutdown
> request is pending.
>
> 3) core stop/restart when convenient - Stop or restart Asterisk when there
> are no calls in the system. New calls are not prevented while the
> shutdown request is pending.
>
> ARI has made stopping/restarting Asterisk more problematic. While a
> shutdown request is pending it is desirable to continue to process ARI
> HTTP requests for current calls. To handle the current calls while a
> shutdown request is pending, a new committed to shutdown phase is needed
> so ARI applications can deal with the calls until the system is fully
> committed to shutdown.
>
> * Added a new shutdown committed phase so ARI applications can deal with
> calls until the final committed to shutdown phase is reached.
>
> * Made refuse new HTTP requests when the system has reached the final
> system shutdown phase.
>
> * Split the bridging framework shutdown to not cleanup the global bridging
> containers when shutting down in a hurry. This is similar to how other
> modules prevent crashes on rapid system shutdown.
>
> * Moved prototypes for ast_begin_shutdown(), ast_cancel_shutdown(), and
> ast_shutting_down() to asterisk.h. You should not have to include
> channel.h just to access these system functions.
>
>
> Diffs
> -----
>
> /branches/13/main/http.c 431537
> /branches/13/main/bridge.c 431537
> /branches/13/main/asterisk.c 431537
> /branches/13/include/asterisk/channel.h 431537
> /branches/13/include/asterisk.h 431537
>
> Diff: https://reviewboard.asterisk.org/r/4399/diff/
>
>
> Testing
> -------
>
> Extended the final shutdown phase sleep so I could send a HTTP request
> while in the final shutdown phase. The HTTP request was not refused while
> the shutdown request was pending and refused after the final shutdown
> phase was reached.
>
>
> Thanks,
>
> rmudgett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150203/7bddb05a/attachment-0001.html>
More information about the asterisk-dev
mailing list