1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-06 22:22:38 +03:00

Control write loop time limit from knob.

Summary:
This has been hardcoded to SRTT/25 for a long time. However, especially when using DSR this might not be the most appropriate since it can start to get close to real world SRTTs.

Control it via a knob, and also add the behavior such that setting it to 0 effectively disables the time limit.

Reviewed By: jbeshay

Differential Revision: D46084438

fbshipit-source-id: 7dc619fdff1bd5c3f8654c4936200e0340ef94f2
This commit is contained in:
Matt Joras
2023-05-22 16:15:24 -07:00
committed by Facebook GitHub Bot
parent 5edf91ff75
commit 96b2c1b37d
6 changed files with 96 additions and 1 deletions

View File

@@ -4077,6 +4077,56 @@ TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFraction) {
res.packetsWritten);
}
TEST_F(QuicTransportFunctionsTest, WriteLimitBytRttFractionNoLimit) {
auto conn = createConn();
conn->lossState.srtt = 50ms;
auto mockCongestionController =
std::make_unique<NiceMock<MockCongestionController>>();
auto rawCongestionController = mockCongestionController.get();
conn->congestionController = std::move(mockCongestionController);
conn->transportSettings.batchingMode = QuicBatchingMode::BATCHING_MODE_NONE;
conn->transportSettings.writeLimitRttFraction = 0;
EventBase evb;
auto socket =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&evb);
auto rawSocket = socket.get();
auto stream1 = conn->streamManager->createNextBidirectionalStream().value();
auto buf = buildRandomInputData(2048 * 2048);
writeDataToQuicStream(*stream1, buf->clone(), true);
EXPECT_CALL(*rawSocket, write(_, _)).WillRepeatedly(Return(1));
EXPECT_CALL(*rawCongestionController, getWritableBytes())
.WillRepeatedly(Return(50));
auto writeLoopBeginTime = Clock::now();
auto res = writeQuicDataToSocket(
*rawSocket,
*conn,
*conn->clientConnectionId,
*conn->serverConnectionId,
*aead,
*headerCipher,
getVersion(*conn),
1000 /* packetLimit */,
writeLoopBeginTime);
EXPECT_GT(1000, res.packetsWritten);
EXPECT_EQ(res.probesWritten, 0);
res = writeQuicDataToSocket(
*rawSocket,
*conn,
*conn->clientConnectionId,
*conn->serverConnectionId,
*aead,
*headerCipher,
getVersion(*conn),
1000 /* packetLimit */,
writeLoopBeginTime);
EXPECT_EQ(1000, res.packetsWritten);
}
TEST_F(QuicTransportFunctionsTest, CongestionControlWritableBytesRoundUp) {
auto conn = createConn();
conn->udpSendPacketLen = 2000;