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

Method throttle_dispatch_queue

src/msg/async/ProtocolV1.cc:741–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741CtPtr ProtocolV1::throttle_dispatch_queue() {
742 ldout(cct, 20) << __func__ << dendl;
743
744 if (cur_msg_size) {
745 if (!connection->dispatch_queue->dispatch_throttler.get_or_fail(
746 cur_msg_size)) {
747 ldout(cct, 1)
748 << __func__ << " wants " << cur_msg_size
749 << " bytes from dispatch throttle "
750 << connection->dispatch_queue->dispatch_throttler.get_current() << "/"
751 << connection->dispatch_queue->dispatch_throttler.get_max()
752 << " failed, just wait." << dendl;
753 // following thread pool deal with th full message queue isn't a
754 // short time, so we can wait a ms.
755 if (connection->register_time_events.empty()) {
756 connection->register_time_events.insert(
757 connection->center->create_time_event(cct->_conf->ms_client_throttle_retry_time_interval,
758 connection->wakeup_handler));
759 }
760 return nullptr;
761 }
762 }
763
764 throttle_stamp = ceph_clock_now();
765
766 state = READ_MESSAGE_FRONT;
767 return read_message_front();
768}
769
770CtPtr ProtocolV1::read_message_front() {
771 ldout(cct, 20) << __func__ << dendl;

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