From 6851a4c845625b0b14bb145177322dafbbc9858e Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Thu, 16 May 2024 09:44:53 +0300 Subject: [PATCH] chore: reset enable_direct_fd to avoid socket leakage in kernel (#3051) The leakage can be identified by checking /proc/net/sockstat Fixes #3045 Signed-off-by: Roman Gershman --- src/server/dfly_main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/dfly_main.cc b/src/server/dfly_main.cc index 87b3c4095501..1d409147c84e 100644 --- a/src/server/dfly_main.cc +++ b/src/server/dfly_main.cc @@ -79,6 +79,10 @@ ABSL_FLAG(bool, version_check, true, ABSL_FLAG(uint16_t, tcp_backlog, 128, "TCP listen(2) backlog parameter."); +#ifdef __linux__ +ABSL_DECLARE_FLAG(bool, enable_direct_fd); +#endif + using namespace util; using namespace facade; using namespace io; @@ -716,6 +720,10 @@ Usage: dragonfly [FLAGS] unique_ptr pool; #ifdef __linux__ + // NOTE: Seems that enable_direct_fd causes sockets leakage. + // Until it is fixed in helio, we disable it. + absl::SetFlag(&FLAGS_enable_direct_fd, false); + base::sys::KernelVersion kver; base::sys::GetKernelVersion(&kver);