Skip to content

Commit

Permalink
chore: reset enable_direct_fd to avoid socket leakage in kernel (#3051)
Browse files Browse the repository at this point in the history
The leakage can be identified by checking /proc/net/sockstat
Fixes #3045

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
  • Loading branch information
romange committed May 16, 2024
1 parent 3dd6c49 commit 6851a4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server/dfly_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -716,6 +720,10 @@ Usage: dragonfly [FLAGS]
unique_ptr<util::ProactorPool> 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);

Expand Down

0 comments on commit 6851a4c

Please sign in to comment.