]> git.apps.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)
committerPrashant D <pdhange@redhat.com>
Wed, 5 Jun 2019 03:18:39 +0000 (23:18 -0400)
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>
(cherry picked from commit 1d464221d998376561c102c83d3127e646815bbb)

Conflicts:
src/common/legacy_config_opts.h : Resolved for ms_connection_idle_timeout
src/common/options.cc : Resolved for ms_connection_idle_timeout
src/msg/simple/Pipe.cc : rename ms_tcp_read_timeout to ms_connection_idle_timeout

src/common/legacy_config_opts.h
src/common/options.cc
src/msg/async/AsyncConnection.cc
src/msg/simple/Pipe.cc
src/test/librados/watch_notify.cc
src/test/msgr/test_msgr.cc

index 33282df763c8257075eff530a41e711b384bbd19..7eb69d54ceb7cc4e9f518b7aa4a111001d74d893 100644 (file)
@@ -138,6 +138,7 @@ OPTION(ms_bind_before_connect, OPT_BOOL)
 OPTION(ms_tcp_listen_backlog, OPT_INT)
 OPTION(ms_rwthread_stack_bytes, OPT_U64)
 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 e34a39c69c8835cda2f11195b9694020b4d0a981..e86bd9d3448cb9911f07dc42b32732bef3ff2886 100644 (file)
@@ -1023,9 +1023,9 @@ std::vector<Option> get_global_options() {
     .set_default(1_M)
     .set_description("Size of stack for SimpleMessenger read/write threads"),
 
-    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 91ea1f6c82786b03039ae13ffce927158fb810f2..272589e4379d5794cb97c2c331864a2e1622f23b 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 822b47f3f4570f5bd7ca627ec4036acbb3905b84..03011df5de1f70bec2b679319f49b29eff02a8b6 100644 (file)
@@ -164,7 +164,7 @@ Pipe::Pipe(SimpleMessenger *r, int st, PipeConnection *con)
 
   randomize_out_seq();
 
-  msgr->timeout = msgr->cct->_conf->ms_tcp_read_timeout * 1000; //convert to ms
+  msgr->timeout = msgr->cct->_conf->ms_connection_idle_timeout * 1000; //convert to ms
   if (msgr->timeout == 0)
     msgr->timeout = -1;
 
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 cbeee9bb1ac49b521f96b99e86a4dabb1d191596..dc8be363f7689d4cfd4c7948605828ddb28c6028 100644 (file)
@@ -1090,7 +1090,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;
   if (string(GetParam()) == "simple")
@@ -1128,7 +1128,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) {