]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: rename ms_tcp_read_timeout to ms_connection_idle_timeout
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 2 Mar 2019 06:12:12 +0000 (14:12 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 3 Apr 2019 07:10:13 +0000 (15:10 +0800)
The old naming is confusing, e.g., it actually indicates we should tear
down the underlying connection which has no read/write activities
at both sides (namely connection is idle) for over 15 minutes.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/legacy_config_opts.h
src/common/options.cc
src/msg/async/AsyncConnection.cc
src/test/librados/watch_notify.cc
src/test/msgr/test_msgr.cc

index c10a906e65957fb23002b850378136ba2a580afb..7fe64976ceeac129d64367c19bedeb7162a87527 100644 (file)
@@ -120,7 +120,7 @@ OPTION(ms_bind_retry_count, OPT_INT) // If binding fails, how many times do we r
 OPTION(ms_bind_retry_delay, OPT_INT) // Delay between attempts to bind
 OPTION(ms_bind_before_connect, OPT_BOOL)
 OPTION(ms_tcp_listen_backlog, OPT_INT)
-OPTION(ms_tcp_read_timeout, OPT_U64)
+OPTION(ms_connection_idle_timeout, OPT_U64)
 OPTION(ms_pq_max_tokens_per_priority, OPT_U64)
 OPTION(ms_pq_min_cost, OPT_U64)
 OPTION(ms_inject_socket_failures, OPT_U64)
index 8a35540db451fd4620b143a9de553a2f6b9fed06..1e6aa4b5fca1b16c920cbe904b97f2f2066fcd18 100644 (file)
@@ -955,9 +955,9 @@ std::vector<Option> get_global_options() {
     .set_default(512)
     .set_description("Size of queue of incoming connections for accept(2)"),
 
-    Option("ms_tcp_read_timeout", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("ms_connection_idle_timeout", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(900)
-    .set_description("Time before an idle TCP connection is closed (seconds)"),
+    .set_description("Time before an idle connection is closed (seconds)"),
 
     Option("ms_pq_max_tokens_per_priority", Option::TYPE_UINT, Option::LEVEL_DEV)
     .set_default(16777216)
index 5de13c32c0294bbb55cfcffc2467e829b306eb6e..7364473ed37eefcfcc2fa1d3bb0ca564a699a253 100644 (file)
@@ -120,7 +120,7 @@ AsyncConnection::AsyncConnection(CephContext *cct, AsyncMessenger *m, DispatchQu
     recv_max_prefetch(std::max<int64_t>(msgr->cct->_conf->ms_tcp_prefetch_max_size, TCP_PREFETCH_MIN_SIZE)),
     recv_start(0), recv_end(0),
     last_active(ceph::coarse_mono_clock::now()),
-    inactive_timeout_us(cct->_conf->ms_tcp_read_timeout*1000*1000),
+    inactive_timeout_us(cct->_conf->ms_connection_idle_timeout*1000*1000),
     msgr2(m2), state_offset(0),
     worker(w), center(&w->center),read_buffer(nullptr)
 {
index 54e54b0803a497be2c714bfdece200b852b2f6e6..5e7c69a49b0ff08b7ed8082bbe798a2c549c6276 100644 (file)
@@ -462,10 +462,10 @@ TEST_F(LibRadosWatchNotify, Watch3Timeout) {
     // timer of timeout on OSD side will be reset by the new request.
     char conf[128];
     ASSERT_EQ(0, rados_conf_get(cluster,
-                                "ms_tcp_read_timeout",
+                                "ms_connection_idle_timeout",
                                 conf, sizeof(conf)));
-    auto tcp_read_timeout = std::stoll(conf);
-    ASSERT_LT(timeout, tcp_read_timeout);
+    auto connection_idle_timeout = std::stoll(conf);
+    ASSERT_LT(timeout, connection_idle_timeout);
   }
   ASSERT_EQ(0,
            rados_watch3(ioctx, notify_oid, &handle,
index da5f1d16cbe982e9be4b5f814e0b4ea3526167bb..9243db606672f0b157e1876460729cad281196e5 100644 (file)
@@ -1061,7 +1061,7 @@ TEST_P(MessengerTest, FeatureTest) {
 }
 
 TEST_P(MessengerTest, TimeoutTest) {
-  g_ceph_context->_conf.set_val("ms_tcp_read_timeout", "1");
+  g_ceph_context->_conf.set_val("ms_connection_idle_timeout", "1");
   FakeDispatcher cli_dispatcher(false), srv_dispatcher(true);
   entity_addr_t bind_addr;
   bind_addr.parse("v2:127.0.0.1");
@@ -1096,7 +1096,7 @@ TEST_P(MessengerTest, TimeoutTest) {
 
   client_msgr->shutdown();
   client_msgr->wait();
-  g_ceph_context->_conf.set_val("ms_tcp_read_timeout", "900");
+  g_ceph_context->_conf.set_val("ms_connection_idle_timeout", "900");
 }
 
 TEST_P(MessengerTest, StatefulTest) {