OPTION(ms_inject_delay_max, OPT_DOUBLE) // seconds
OPTION(ms_inject_delay_probability, OPT_DOUBLE) // range [0, 1]
OPTION(ms_inject_internal_delays, OPT_DOUBLE) // seconds
+OPTION(ms_blackhole_osd, OPT_BOOL)
+OPTION(ms_blackhole_mon, OPT_BOOL)
+OPTION(ms_blackhole_mds, OPT_BOOL)
+OPTION(ms_blackhole_mgr, OPT_BOOL)
+OPTION(ms_blackhole_client, OPT_BOOL)
OPTION(ms_dump_on_send, OPT_BOOL) // hexdump msg to log on send
OPTION(ms_dump_corrupt_message_level, OPT_INT) // debug level to hexdump undecodeable messages at
OPTION(ms_async_op_threads, OPT_U64) // number of worker processing threads for async messenger created on init
.set_default(0)
.set_description("Inject various internal delays to induce races (seconds)"),
+ Option("ms_blackhole_osd", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_description(""),
+
+ Option("ms_blackhole_mon", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_description(""),
+
+ Option("ms_blackhole_mds", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_description(""),
+
+ Option("ms_blackhole_mgr", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_description(""),
+
+ Option("ms_blackhole_client", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_description(""),
+
Option("ms_dump_on_send", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(false)
.set_description("Hexdump message to debug log on message send"),
<< this
<< dendl;
+ auto cct = async_msgr->cct;
+ if ((cct->_conf->ms_blackhole_mon && peer_type == CEPH_ENTITY_TYPE_MON)||
+ (cct->_conf->ms_blackhole_osd && peer_type == CEPH_ENTITY_TYPE_OSD)||
+ (cct->_conf->ms_blackhole_mds && peer_type == CEPH_ENTITY_TYPE_MDS)||
+ (cct->_conf->ms_blackhole_client &&
+ peer_type == CEPH_ENTITY_TYPE_CLIENT)) {
+ lgeneric_subdout(cct, ms, 0) << __func__ << ceph_entity_type_name(peer_type)
+ << " blackhole " << *m << dendl;
+ m->put();
+ return 0;
+ }
+
// optimistic think it's ok to encode(actually may broken now)
if (!m->get_priority())
m->set_priority(async_msgr->get_default_send_priority());
state = OPENED;
+ ceph::mono_time fast_dispatch_time;
+
+ auto& conf = cct->_conf;
+ if ((conf->ms_blackhole_mon && connection->peer_type == CEPH_ENTITY_TYPE_MON)||
+ (conf->ms_blackhole_osd && connection->peer_type == CEPH_ENTITY_TYPE_OSD)||
+ (conf->ms_blackhole_mds && connection->peer_type == CEPH_ENTITY_TYPE_MDS)||
+ (conf->ms_blackhole_client &&
+ connection->peer_type == CEPH_ENTITY_TYPE_CLIENT)) {
+ ldout(cct, 10) << __func__ << " blackhole " << *message << dendl;
+ message->put();
+ goto out;
+ }
+
connection->logger->inc(l_msgr_recv_messages);
connection->logger->inc(
l_msgr_recv_bytes,
cur_msg_size + sizeof(ceph_msg_header) + sizeof(ceph_msg_footer));
messenger->ms_fast_preprocess(message);
- auto fast_dispatch_time = ceph::mono_clock::now();
+ fast_dispatch_time = ceph::mono_clock::now();
connection->logger->tinc(l_msgr_running_recv_time,
- fast_dispatch_time - connection->recv_start_time);
+ fast_dispatch_time - connection->recv_start_time);
if (connection->delay_state) {
double delay_period = 0;
if (rand() % 10000 < cct->_conf->ms_inject_delay_probability * 10000.0) {
connection->conn_id);
}
+ out:
// clean up local buffer references
data_buf.clear();
front.clear();
state = READY;
+ ceph::mono_time fast_dispatch_time;
+
+ auto& conf = cct->_conf;
+ if ((conf->ms_blackhole_mon && connection->peer_type == CEPH_ENTITY_TYPE_MON)||
+ (conf->ms_blackhole_osd && connection->peer_type == CEPH_ENTITY_TYPE_OSD)||
+ (conf->ms_blackhole_mds && connection->peer_type == CEPH_ENTITY_TYPE_MDS)||
+ (conf->ms_blackhole_client &&
+ connection->peer_type == CEPH_ENTITY_TYPE_CLIENT)) {
+ ldout(cct, 10) << __func__ << " blackhole " << *message << dendl;
+ message->put();
+ goto out;
+ }
+
connection->logger->inc(l_msgr_recv_messages);
connection->logger->inc(
l_msgr_recv_bytes,
cur_msg_size + sizeof(ceph_msg_header) + sizeof(ceph_msg_footer));
messenger->ms_fast_preprocess(message);
- auto fast_dispatch_time = ceph::mono_clock::now();
+ fast_dispatch_time = ceph::mono_clock::now();
connection->logger->tinc(l_msgr_running_recv_time,
- fast_dispatch_time - connection->recv_start_time);
+ fast_dispatch_time - connection->recv_start_time);
if (connection->delay_state) {
double delay_period = 0;
if (rand() % 10000 < cct->_conf->ms_inject_delay_probability * 10000.0) {
handle_message_ack(current_header.ack_seq);
-
+ out:
if (need_dispatch_writer && connection->is_connected()) {
connection->center->dispatch_event_external(connection->write_handler);
}