From 448d065647388a10ed1fa380d56e2076e8dea145 Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Sun, 26 Jun 2022 17:25:42 +0300 Subject: [PATCH] fix(server): Fix a crash when running "client list" command. (#179) Also, enhance release script to apply linker optimizations when building the binaries. Signed-off-by: Roman Gershman --- src/facade/dragonfly_connection.cc | 4 +++- src/server/generic_family.cc | 4 ++-- tools/release.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/facade/dragonfly_connection.cc b/src/facade/dragonfly_connection.cc index f06f3ef..397fbd4 100644 --- a/src/facade/dragonfly_connection.cc +++ b/src/facade/dragonfly_connection.cc @@ -290,7 +290,9 @@ string Connection::GetClientInfo() const { absl::StrAppend(&res, " fd=", lsb->native_handle(), " name=", name_); absl::StrAppend(&res, " age=", now - creation_time_, " idle=", now - last_interaction_); absl::StrAppend(&res, " phase=", phase_, " "); - absl::StrAppend(&res, cc_->GetContextInfo()); + if (cc_) { + absl::StrAppend(&res, cc_->GetContextInfo()); + } return res; } diff --git a/src/server/generic_family.cc b/src/server/generic_family.cc index d515b36..d757283 100644 --- a/src/server/generic_family.cc +++ b/src/server/generic_family.cc @@ -739,10 +739,10 @@ void GenericFamily::Register(CommandRegistry* registry) { << CI{"RENAME", CO::WRITE, 3, 1, 2, 1}.HFUNC(Rename) << CI{"RENAMENX", CO::WRITE, 3, 1, 2, 1}.HFUNC(RenameNx) << CI{"SELECT", kSelectOpts, 2, 0, 0, 0}.HFUNC(Select) - << CI{"SCAN", CO::READONLY | CO::FAST, -2, 0, 0, 0}.HFUNC(Scan) + << CI{"SCAN", CO::READONLY | CO::FAST | CO::LOADING, -2, 0, 0, 0}.HFUNC(Scan) << CI{"TTL", CO::READONLY | CO::FAST, 2, 1, 1, 1}.HFUNC(Ttl) << CI{"PTTL", CO::READONLY | CO::FAST, 2, 1, 1, 1}.HFUNC(Pttl) - << CI{"TYPE", CO::READONLY | CO::FAST, 2, 1, 1, 1}.HFUNC(Type) + << CI{"TYPE", CO::READONLY | CO::FAST | CO::LOADING, 2, 1, 1, 1}.HFUNC(Type) << CI{"UNLINK", CO::WRITE, -2, 1, -1, 1}.HFUNC(Del); } diff --git a/tools/release.sh b/tools/release.sh index 7fca396..983846a 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -12,7 +12,7 @@ NAME="dragonfly-${ARCH}" pwd ./helio/blaze.sh -release -DBoost_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON \ - -DENABLE_GIT_VERSION=ON -DWITH_UNWIND=OFF + -DENABLE_GIT_VERSION=ON -DWITH_UNWIND=OFF -DHELIO_RELEASE_FLAGS="-flto" cd build-opt ninja dragonfly && ldd dragonfly