Skip to content

Commit 2becb83

Browse files
BenHuddlestondaverigby
authored andcommitted
MB-45214: Log shutdown due to stdin closure/shutdown message
It's good to know why we shutdown so log shut downs due to stdin closure or a shutdown message in the memcached.log file (currently it's just printed on stderr). Change-Id: I1a07db85361b04014bf43f0246e0924559ac70b7 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/172766 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent d83ac3e commit 2becb83

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

daemon/memcached.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,12 @@ int memcached_main(int argc, char** argv) {
905905

906906
if (Settings::instance().isStdinListenerEnabled()) {
907907
LOG_INFO_RAW("Enable standard input listener");
908-
start_stdin_listener(shutdown_server);
908+
start_stdin_listener([]() {
909+
LOG_INFO_RAW(
910+
"Gracefully shutting down due to shutdown message or "
911+
"stdin closure");
912+
shutdown_server();
913+
});
909914
}
910915

911916
#ifdef HAVE_LIBNUMA

0 commit comments

Comments
 (0)