mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-07-30 14:43:05 +03:00
Back out "If there's lost data, we have data to write."
Summary: This is causing empty write loops for some reason. Reviewed By: jbeshay, lnicco Differential Revision: D32990291 fbshipit-source-id: 2a183d591de54c7fe0ca54aea828a697a4cd9af0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1e7287fcdb
commit
5b9a9705a0
@ -473,9 +473,8 @@ void StreamFrameScheduler::writeStreams(PacketBuilderInterface& builder) {
|
||||
} // namespace quic
|
||||
|
||||
bool StreamFrameScheduler::hasPendingData() const {
|
||||
return conn_.streamManager->hasLoss() ||
|
||||
(conn_.streamManager->hasNonDSRWritable() &&
|
||||
getSendConnFlowControlBytesWire(conn_) > 0);
|
||||
return conn_.streamManager->hasNonDSRWritable() &&
|
||||
getSendConnFlowControlBytesWire(conn_) > 0;
|
||||
}
|
||||
|
||||
bool StreamFrameScheduler::writeStreamFrame(
|
||||
|
@ -1601,10 +1601,8 @@ WriteDataReason hasNonAckDataToWrite(const QuicConnectionStateBase& conn) {
|
||||
if (conn.streamManager->hasBlocked()) {
|
||||
return WriteDataReason::BLOCKED;
|
||||
}
|
||||
// If we have lost data or flow control + stream data.
|
||||
if (conn.streamManager->hasLoss() ||
|
||||
(getSendConnFlowControlBytesWire(conn) != 0 &&
|
||||
conn.streamManager->hasWritable())) {
|
||||
if (getSendConnFlowControlBytesWire(conn) != 0 &&
|
||||
conn.streamManager->hasWritable()) {
|
||||
return WriteDataReason::STREAM;
|
||||
}
|
||||
if (!conn.pendingEvents.frames.empty()) {
|
||||
|
@ -1641,7 +1641,6 @@ TEST_F(QuicPacketSchedulerTest, WriteLossWithoutFlowControl) {
|
||||
conn.streamManager->updateWritableStreams(*stream);
|
||||
|
||||
StreamFrameScheduler scheduler(conn);
|
||||
EXPECT_TRUE(scheduler.hasPendingData());
|
||||
ShortHeader shortHeader1(
|
||||
ProtectionType::KeyPhaseZero,
|
||||
getTestConnectionId(),
|
||||
@ -1667,8 +1666,6 @@ TEST_F(QuicPacketSchedulerTest, WriteLossWithoutFlowControl) {
|
||||
stream->lossBuffer.emplace_back(std::move(*stream->retransmissionBuffer[0]));
|
||||
stream->retransmissionBuffer.clear();
|
||||
conn.streamManager->updateWritableStreams(*stream);
|
||||
conn.streamManager->updateLossStreams(*stream);
|
||||
EXPECT_TRUE(scheduler.hasPendingData());
|
||||
|
||||
// Write again
|
||||
ShortHeader shortHeader2(
|
||||
|
@ -2804,24 +2804,6 @@ TEST_F(QuicTransportFunctionsTest, ShouldWriteDataNoConnFlowControl) {
|
||||
EXPECT_EQ(WriteDataReason::NO_WRITE, shouldWriteData(*conn));
|
||||
}
|
||||
|
||||
TEST_F(QuicTransportFunctionsTest, ShouldWriteDataNoConnFlowControlLoss) {
|
||||
auto conn = createConn();
|
||||
conn->oneRttWriteCipher = test::createNoOpAead();
|
||||
auto mockCongestionController =
|
||||
std::make_unique<NiceMock<MockCongestionController>>();
|
||||
auto rawCongestionController = mockCongestionController.get();
|
||||
EXPECT_CALL(*rawCongestionController, getWritableBytes())
|
||||
.WillRepeatedly(Return(1500));
|
||||
auto stream1 = conn->streamManager->createNextBidirectionalStream().value();
|
||||
auto buf = IOBuf::copyBuffer("0123456789");
|
||||
writeDataToQuicStream(*stream1, buf->clone(), false);
|
||||
EXPECT_NE(WriteDataReason::NO_WRITE, shouldWriteData(*conn));
|
||||
// Artificially limit the connection flow control.
|
||||
conn->streamManager->addLoss(stream1->id);
|
||||
conn->flowControlState.peerAdvertisedMaxOffset = 0;
|
||||
EXPECT_NE(WriteDataReason::NO_WRITE, shouldWriteData(*conn));
|
||||
}
|
||||
|
||||
TEST_F(QuicTransportFunctionsTest, HasAckDataToWriteCipherAndAckStateMatch) {
|
||||
auto conn = createConn();
|
||||
EXPECT_FALSE(hasAckDataToWrite(*conn));
|
||||
|
@ -270,17 +270,7 @@ TEST_F(QuicTransportTest, NotAppLimitedWithLoss) {
|
||||
|
||||
auto stream = transport_->createBidirectionalStream().value();
|
||||
auto lossStream = transport_->createBidirectionalStream().value();
|
||||
auto lossStreamState = conn.streamManager->findStream(lossStream);
|
||||
ASSERT_TRUE(lossStreamState);
|
||||
auto largeBuf = folly::IOBuf::createChain(conn.udpSendPacketLen * 20, 4096);
|
||||
auto curBuf = largeBuf.get();
|
||||
do {
|
||||
curBuf->append(curBuf->capacity());
|
||||
curBuf = curBuf->next();
|
||||
} while (curBuf != largeBuf.get());
|
||||
lossStreamState->lossBuffer.emplace_back(std::move(largeBuf), 31, false);
|
||||
conn.streamManager->updateWritableStreams(*lossStreamState);
|
||||
conn.streamManager->updateLossStreams(*lossStreamState);
|
||||
conn.streamManager->addLoss(lossStream);
|
||||
transport_->writeChain(
|
||||
stream, IOBuf::copyBuffer("An elephant sitting still"), false, nullptr);
|
||||
EXPECT_CALL(*rawCongestionController, setAppLimited()).Times(0);
|
||||
|
Reference in New Issue
Block a user