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

No more Pending mode in Quic ack writing

Summary:
The AckScheduler right now has two modes: Immediate mode which always
write acks into the current packet, pending mode which only write if
needsToSendAckImmediately is true. The FrameScheduler choose the Immdiate mode
if there are other data to write as well. Otherwise, it chooses the Pending
mode. But if there is no other data to write and needsToSendAckImmediately is
false, the FrameScheduler will end up writing nothing.

This isn't a problem today because to be on the write path, the shouldWriteData
function would make sure we either have non-ack data to write, or
needsToSendAckImmediately is true for a packet number space. But once we allow
packets in Initial and Handshake space to be cloned, we would be on the write
path when there are probe quota. The FrameScheduler's hasData function doesn't
check needsToSendAckImmediately. It will think it has data to write as long as
AckState has changed, but can ends up writing nothing with the Pending ack
mode.

I think given the write looper won't be schedule to loop when there is no
non-ack data to write and needsToSendAckImmediately is true, it's safe to
remove Pending ack mode from AckScheduler.

Reviewed By: mjoras

Differential Revision: D22044741

fbshipit-source-id: 26fcaabdd5c45c1cae12d459ee5924a30936e209
This commit is contained in:
Yang Chi
2020-06-18 15:28:59 -07:00
committed by Facebook GitHub Bot
parent 2cbb9f98e4
commit 25a646f96a
5 changed files with 7 additions and 65 deletions

View File

@@ -1856,10 +1856,11 @@ TEST_F(QuicTransportFunctionsTest, HasAckDataToWriteCipherAndAckStateMatch) {
TEST_F(QuicTransportFunctionsTest, HasAckDataToWriteNoImmediateAcks) {
auto conn = createConn();
conn->oneRttWriteCipher = test::createNoOpAead();
conn->ackStates.initialAckState.needsToSendAckImmediately = false;
conn->ackStates.handshakeAckState.needsToSendAckImmediately = false;
conn->ackStates.appDataAckState.acks.insert(0, 100);
conn->ackStates.appDataAckState.needsToSendAckImmediately = false;
EXPECT_FALSE(hasAckDataToWrite(*conn));
conn->ackStates.appDataAckState.needsToSendAckImmediately = true;
EXPECT_TRUE(hasAckDataToWrite(*conn));
}
TEST_F(QuicTransportFunctionsTest, HasAckDataToWriteNoAcksScheduled) {