mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-06 22:22:38 +03:00
Incorporate throttling signal into BBRv1: limit the writable bytes by the available tokens
Summary: This limits the writableBytes by the available tokens (ie `ThrottlingSignalProvider::bytesToSend`), if the connection is being throttled and that value is provided by the throttling signal provider. Note that these throttling signals to the transport are provided only for the connections that belong to a specific QE experiment. Reviewed By: silver23arrow Differential Revision: D47850261 fbshipit-source-id: 8c52e66198db6d1fee252cacea69b82963a1601a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4862982004
commit
7af4ddc0e0
@@ -4761,5 +4761,36 @@ TEST_F(QuicTransportFunctionsTest, CustomTransportParamTest) {
|
||||
EXPECT_EQ(customTransportParameters.size(), 2);
|
||||
}
|
||||
|
||||
TEST_F(
|
||||
QuicTransportFunctionsTest,
|
||||
StaticCapOnWritableBytesFromThrottlingSignalProvider) {
|
||||
auto conn = createConn();
|
||||
conn->udpSendPacketLen = 2000;
|
||||
auto mockCongestionController =
|
||||
std::make_unique<NiceMock<MockCongestionController>>();
|
||||
auto rawCongestionController = mockCongestionController.get();
|
||||
conn->congestionController = std::move(mockCongestionController);
|
||||
|
||||
auto mockThrottlingSignalProvider =
|
||||
std::make_shared<MockThrottlingSignalProvider>();
|
||||
ThrottlingSignalProvider::ThrottlingSignal expectedSignal;
|
||||
expectedSignal.state =
|
||||
ThrottlingSignalProvider::ThrottlingSignal::State::Throttled;
|
||||
expectedSignal.maybeBytesToSend = 16000;
|
||||
mockThrottlingSignalProvider->useFakeThrottlingSignal(expectedSignal);
|
||||
conn->throttlingSignalProvider = mockThrottlingSignalProvider;
|
||||
|
||||
EXPECT_CALL(*rawCongestionController, getWritableBytes())
|
||||
.WillOnce(Return(10000));
|
||||
EXPECT_EQ(10000, congestionControlWritableBytes(*conn));
|
||||
|
||||
// Since cwnd is larger than available tokens, the writable bytes is capped by
|
||||
// the available tokens
|
||||
EXPECT_CALL(*rawCongestionController, getWritableBytes())
|
||||
.WillOnce(Return(20000));
|
||||
EXPECT_EQ(
|
||||
expectedSignal.maybeBytesToSend, congestionControlWritableBytes(*conn));
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace quic
|
||||
|
Reference in New Issue
Block a user