MCPcopy Create free account
hub / github.com/ceph/ceph / throttle_dispatch_queue

Method throttle_dispatch_queue

src/msg/async/ProtocolV2.cc:1641–1669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1639}
1640
1641CtPtr ProtocolV2::throttle_dispatch_queue() {
1642 ldout(cct, 20) << __func__ << dendl;
1643
1644 const size_t cur_msg_size = get_current_msg_size();
1645 if (cur_msg_size) {
1646 if (!connection->dispatch_queue->dispatch_throttler.get_or_fail(
1647 cur_msg_size)) {
1648 ldout(cct, 1)
1649 << __func__ << " wants " << cur_msg_size
1650 << " bytes from dispatch throttle "
1651 << connection->dispatch_queue->dispatch_throttler.get_current() << "/"
1652 << connection->dispatch_queue->dispatch_throttler.get_max()
1653 << " failed, just wait." << dendl;
1654 // following thread pool deal with th full message queue isn't a
1655 // short time, so we can wait a ms.
1656 if (connection->register_time_events.empty()) {
1657 connection->register_time_events.insert(
1658 connection->center->create_time_event(cct->_conf->ms_client_throttle_retry_time_interval,
1659 connection->wakeup_handler));
1660 }
1661 return nullptr;
1662 }
1663 }
1664
1665 throttle_stamp = ceph_clock_now();
1666 state = THROTTLE_DONE;
1667
1668 return read_frame_segment();
1669}
1670
1671CtPtr ProtocolV2::handle_keepalive2(ceph::bufferlist &payload)
1672{

Callers

nothing calls this directly

Calls 7

ceph_clock_nowFunction · 0.85
get_or_failMethod · 0.80
create_time_eventMethod · 0.80
get_currentMethod · 0.45
get_maxMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected