mirror of
https://github.com/ceph/ceph
synced 2025-01-19 09:32:00 +00:00
msg/simple/DispatchQueue: inject internal delays in special event dispatch
E.g., connection reset. This will help uncover subtle races. Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
c04fd4210f
commit
df4e134334
@ -150,6 +150,15 @@ void DispatchQueue::entry()
|
||||
lock.Unlock();
|
||||
|
||||
if (qitem.is_code()) {
|
||||
if (cct->_conf->ms_inject_internal_delays &&
|
||||
cct->_conf->ms_inject_delay_probability &&
|
||||
(rand() % 10000)/10000.0 < cct->_conf->ms_inject_delay_probability) {
|
||||
utime_t t;
|
||||
t.set_from_double(cct->_conf->ms_inject_internal_delays);
|
||||
ldout(cct, 1) << "DispatchQueue::entry inject delay of " << t
|
||||
<< dendl;
|
||||
t.sleep();
|
||||
}
|
||||
switch (qitem.get_code()) {
|
||||
case D_BAD_REMOTE_RESET:
|
||||
msgr->ms_deliver_handle_remote_reset(qitem.get_connection());
|
||||
|
Loading…
Reference in New Issue
Block a user