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
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)
.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)
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)
{
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;
// 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,
}
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")
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) {