mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
main: Stop http server
Currently it's not stopped at all, so calling a REST request shutdown-time may crash things at random places. Fixes: #5702 But it's not the end of the story. Since the server stays up while we are shutting things down, each subsystem should carefully handle the cases when it's half-down, but a request comes. A better solution is to unregister rest verbs eventually, but httpd's rules cannot do it now. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
3
main.cc
3
main.cc
@@ -710,6 +710,9 @@ int main(int ac, char** av) {
|
||||
}();
|
||||
supervisor::notify("starting API server");
|
||||
ctx.http_server.start("API").get();
|
||||
auto stop_http_server = defer_verbose_shutdown("API server", [&ctx] {
|
||||
ctx.http_server.stop().get();
|
||||
});
|
||||
api::set_server_init(ctx).get();
|
||||
with_scheduling_group(maintenance_scheduling_group, [&] {
|
||||
return ctx.http_server.listen(socket_address{ip, api_port});
|
||||
|
||||
Reference in New Issue
Block a user