| 705 | } |
| 706 | |
| 707 | CtPtr ProtocolV1::throttle_bytes() { |
| 708 | ldout(cct, 20) << __func__ << dendl; |
| 709 | |
| 710 | cur_msg_size = current_header.front_len + current_header.middle_len + |
| 711 | current_header.data_len; |
| 712 | if (cur_msg_size) { |
| 713 | if (connection->policy.throttler_bytes) { |
| 714 | ldout(cct, 10) << __func__ << " wants " << cur_msg_size |
| 715 | << " bytes from policy throttler " |
| 716 | << connection->policy.throttler_bytes->get_current() << "/" |
| 717 | << connection->policy.throttler_bytes->get_max() << dendl; |
| 718 | if (!connection->policy.throttler_bytes->get_or_fail(cur_msg_size)) { |
| 719 | ldout(cct, 1) << __func__ << " wants " << cur_msg_size |
| 720 | << " bytes from policy throttler " |
| 721 | << connection->policy.throttler_bytes->get_current() |
| 722 | << "/" << connection->policy.throttler_bytes->get_max() |
| 723 | << " failed, just wait." << dendl; |
| 724 | // following thread pool deal with th full message queue isn't a |
| 725 | // short time, so we can wait a ms. |
| 726 | if (connection->register_time_events.empty()) { |
| 727 | connection->register_time_events.insert( |
| 728 | connection->center->create_time_event( |
| 729 | cct->_conf->ms_client_throttle_retry_time_interval, |
| 730 | connection->wakeup_handler)); |
| 731 | } |
| 732 | return nullptr; |
| 733 | } |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | state = THROTTLE_DISPATCH_QUEUE; |
| 738 | return CONTINUE(throttle_dispatch_queue); |
| 739 | } |
| 740 | |
| 741 | CtPtr ProtocolV1::throttle_dispatch_queue() { |
| 742 | ldout(cct, 20) << __func__ << dendl; |
nothing calls this directly
no test coverage detected