This is an automated email from the ASF dual-hosted git repository.

twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new f98cb0c7 feat(cmd): add more information to shutdown log (#2672)
f98cb0c7 is described below

commit f98cb0c79a60481913eef0d970cd7b10a6407de9
Author: Twice <[email protected]>
AuthorDate: Wed Nov 20 01:52:43 2024 +0800

    feat(cmd): add more information to shutdown log (#2672)
---
 src/cli/main.cc            | 4 ++--
 src/commands/cmd_server.cc | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cli/main.cc b/src/cli/main.cc
index 9eeab518..11a64760 100644
--- a/src/cli/main.cc
+++ b/src/cli/main.cc
@@ -47,7 +47,7 @@ Server *srv = nullptr;
 
 extern "C" void SignalHandler([[maybe_unused]] int sig) {
   if (srv && !srv->IsStopped()) {
-    LOG(INFO) << "Bye Bye";
+    LOG(INFO) << "Signal " << sig << " received, stopping the server";
     srv->Stop();
   }
 }
@@ -116,6 +116,7 @@ static void InitGoogleLog(const Config *config) {
 
 int main(int argc, char *argv[]) {
   srand(static_cast<unsigned>(util::GetTimeStamp()));
+  crc64_init();
 
   evthread_use_pthreads();
   auto event_exit = MakeScopeExit(libevent_global_shutdown);
@@ -137,7 +138,6 @@ int main(int argc, char *argv[]) {
     }
   });
 
-  crc64_init();
   InitGoogleLog(&config);
   google::InitGoogleLogging("kvrocks");
   auto glog_exit = MakeScopeExit(google::ShutdownGoogleLogging);
diff --git a/src/commands/cmd_server.cc b/src/commands/cmd_server.cc
index c7f74265..f17903c2 100644
--- a/src/commands/cmd_server.cc
+++ b/src/commands/cmd_server.cc
@@ -544,7 +544,7 @@ class CommandShutdown : public Commander {
     }
 
     if (!srv->IsStopped()) {
-      LOG(INFO) << "bye bye";
+      LOG(INFO) << "SHUTDOWN command received, stopping the server";
       srv->Stop();
     }
     return Status::OK();
@@ -1344,7 +1344,7 @@ REDIS_REGISTER_COMMANDS(Server, 
MakeCmdAttr<CommandAuth>("auth", 2, "read-only o
                         MakeCmdAttr<CommandPerfLog>("perflog", -2, 
"read-only", NO_KEY),
                         MakeCmdAttr<CommandClient>("client", -2, "read-only", 
NO_KEY),
                         MakeCmdAttr<CommandMonitor>("monitor", 1, "read-only 
no-multi no-script", NO_KEY),
-                        MakeCmdAttr<CommandShutdown>("shutdown", 1, "read-only 
no-multi no-script", NO_KEY),
+                        MakeCmdAttr<CommandShutdown>("shutdown", 1, "read-only 
exclusive no-multi no-script", NO_KEY),
                         MakeCmdAttr<CommandQuit>("quit", 1, "read-only", 
NO_KEY),
                         MakeCmdAttr<CommandScan>("scan", -2, "read-only", 
NO_KEY),
                         MakeCmdAttr<CommandRandomKey>("randomkey", 1, 
"read-only", NO_KEY),

Reply via email to