Merge pull request #54668 from qiuxinyidian/rgw-frontend

add checking for rgw frontend init

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>
This commit is contained in:
Casey Bodley 2023-12-08 19:44:35 +00:00 committed by GitHub
commit dc634cc4d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -468,6 +468,7 @@ namespace rgw {
int RGWLib::init(vector<const char*>& args)
{
int r{0};
/* alternative default for module */
map<std::string,std::string> defaults = {
{ "debug_rgw", "1/5" },
@ -524,7 +525,13 @@ namespace rgw {
register_async_signal_handler(SIGUSR1, rgw::signal::handle_sigterm);
main.init_tracepoints();
main.init_frontends2(this /* rgwlib */);
r = main.init_frontends2(this /* rgwlib */);
if (r != 0) {
derr << "ERROR: unable to initialize frontend, r = " << r << dendl;
main.shutdown();
return r;
}
main.init_notification_endpoints();
main.init_lua();

View File

@ -157,7 +157,12 @@ int main(int argc, char *argv[])
main.init_opslog();
main.init_tracepoints();
main.init_lua();
main.init_frontends2(nullptr /* RGWLib */);
r = main.init_frontends2(nullptr /* RGWLib */);
if (r != 0) {
derr << "ERROR: initialize frontend fail, r = " << r << dendl;
main.shutdown();
return r;
}
main.init_notification_endpoints();
#if defined(HAVE_SYS_PRCTL_H)