1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-09 20:42:44 +03:00

Do not enable pacing if transport doesn't have pacing timer

Summary:
LOG an error and fallback to no pacing. This diff also stops
supporting automaticaly set pacingEnabled to true when BBR is enabled.

Reviewed By: mjoras

Differential Revision: D22875904

fbshipit-source-id: f8c8c9ea252f6e5e86f83174309b159ce93b3919
This commit is contained in:
Yang Chi
2020-08-03 10:37:39 -07:00
committed by Facebook GitHub Bot
parent 086a9fd97e
commit 06083595e3
5 changed files with 57 additions and 18 deletions

View File

@@ -2450,6 +2450,37 @@ TEST_F(QuicTransportTest, NotifyPendingWriteConnBufferFreeUpSpace) {
NetworkData(IOBuf::copyBuffer("fake data"), Clock::now()));
}
TEST_F(QuicTransportTest, NoPacingTimerNoPacing) {
TransportSettings transportSettings;
transportSettings.pacingEnabled = true;
transport_->setTransportSettings(transportSettings);
transport_->getConnectionState().canBePaced = true;
EXPECT_FALSE(isConnectionPaced(transport_->getConnectionState()));
}
TEST_F(QuicTransportTest, SetPacingTimerThenEnablesPacing) {
TransportSettings transportSettings;
transportSettings.pacingEnabled = true;
transport_->setPacingTimer(
TimerHighRes::newTimer(&evb_, transportSettings.pacingTimerTickInterval));
transport_->setTransportSettings(transportSettings);
transport_->getConnectionState().canBePaced = true;
EXPECT_TRUE(isConnectionPaced(transport_->getConnectionState()));
}
TEST_F(QuicTransportTest, NoPacingNoBbr) {
TransportSettings transportSettings;
transportSettings.defaultCongestionController = CongestionControlType::BBR;
transportSettings.pacingEnabled = false;
auto ccFactory = std::make_shared<DefaultCongestionControllerFactory>();
transport_->setCongestionControllerFactory(ccFactory);
transport_->setTransportSettings(transportSettings);
EXPECT_FALSE(isConnectionPaced(transport_->getConnectionState()));
EXPECT_NE(
CongestionControlType::BBR,
transport_->getTransportInfo().congestionControlType);
}
TEST_F(QuicTransportTest, NotifyPendingWriteConnBufferUseTotalSpace) {
TransportSettings transportSettings;
transportSettings.totalBufferSpaceAvailable = 100;