]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: configurable threshold for reaping dead connections
authorSage Weil <sage@newdream.net>
Wed, 19 May 2021 19:23:26 +0000 (15:23 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 26 Aug 2021 16:26:18 +0000 (12:26 -0400)
It is helpful to set this to 1 for tests.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 8129d6bb953015cc05db458afa6aa9b8f5f62614)

Conflicts:
src/common/options/global.yaml.in

src/common/options.cc
src/msg/async/AsyncMessenger.h

index 11f2a6812a270065c3bb70c71a5fb053f6ee3ce9..bdec3edafcdbcbb88e60ed754d39614fe3573f5a 100644 (file)
@@ -1153,6 +1153,11 @@ std::vector<Option> get_global_options() {
     .set_description("Maximum threadpool size of AsyncMessenger")
     .add_see_also("ms_async_op_threads"),
 
+    Option("ms_async_reap_threshold", Option::TYPE_UINT, Option::LEVEL_DEV)
+    .set_default(5)
+    .set_min(1)
+    .set_description("number of deleted connections before we reap"),
+
     Option("ms_async_rdma_device_name", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("")
     .set_description(""),
index 625cb099c5a6f8f131082ee74734b5695ceb7558..e35d02dc42b2d3b6b67aece792cd3f31f17dd306 100644 (file)
@@ -209,8 +209,6 @@ private:
   entity_addrvec_t _filter_addrs(const entity_addrvec_t& addrs);
 
  private:
-  static const uint64_t ReapDeadConnectionThreshold = 5;
-
   NetworkStack *stack;
   std::vector<Processor*> processors;
   friend class Processor;
@@ -404,7 +402,7 @@ public:
     deleted_conns.emplace(std::move(conn));
     conn->unregister();
 
-    if (deleted_conns.size() >= ReapDeadConnectionThreshold) {
+    if (deleted_conns.size() >= cct->_conf.get_val<uint64_t>("ms_async_reap_threshold")) {
       local_worker->center.dispatch_event_external(reap_handler);
     }
   }