| 1606 | } |
| 1607 | |
| 1608 | CtPtr ProtocolV2::throttle_bytes() { |
| 1609 | ldout(cct, 20) << __func__ << dendl; |
| 1610 | |
| 1611 | const size_t cur_msg_size = get_current_msg_size(); |
| 1612 | if (cur_msg_size) { |
| 1613 | if (connection->policy.throttler_bytes) { |
| 1614 | ldout(cct, 10) << __func__ << " wants " << cur_msg_size |
| 1615 | << " bytes from policy throttler " |
| 1616 | << connection->policy.throttler_bytes->get_current() << "/" |
| 1617 | << connection->policy.throttler_bytes->get_max() << dendl; |
| 1618 | if (!connection->policy.throttler_bytes->get_or_fail(cur_msg_size)) { |
| 1619 | ldout(cct, 1) << __func__ << " wants " << cur_msg_size |
| 1620 | << " bytes from policy throttler " |
| 1621 | << connection->policy.throttler_bytes->get_current() |
| 1622 | << "/" << connection->policy.throttler_bytes->get_max() |
| 1623 | << " failed, just wait." << dendl; |
| 1624 | // following thread pool deal with th full message queue isn't a |
| 1625 | // short time, so we can wait a ms. |
| 1626 | if (connection->register_time_events.empty()) { |
| 1627 | connection->register_time_events.insert( |
| 1628 | connection->center->create_time_event( |
| 1629 | cct->_conf->ms_client_throttle_retry_time_interval, |
| 1630 | connection->wakeup_handler)); |
| 1631 | } |
| 1632 | return nullptr; |
| 1633 | } |
| 1634 | } |
| 1635 | } |
| 1636 | |
| 1637 | state = THROTTLE_DISPATCH_QUEUE; |
| 1638 | return CONTINUE(throttle_dispatch_queue); |
| 1639 | } |
| 1640 | |
| 1641 | CtPtr ProtocolV2::throttle_dispatch_queue() { |
| 1642 | ldout(cct, 20) << __func__ << dendl; |
nothing calls this directly
no test coverage detected