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

Fix stream scheduling round robin.

Summary:
The intention here was always to write to streams in a round robin fashion. However, this functionality has been effectively broken since introduction as `lastScheduledStream` was never set. We can fix this by having the `StreamFrameScheduler` set `nextScheduledStream` after it has written to the streams. Additionally we need to remove a check that kept us from moving past a stream if it still had data left to write.

In extreme cases this would cause streams to be completely starved, and ruin concurrency.

Reviewed By: siyengar

Differential Revision: D17748652

fbshipit-source-id: a3d05c54ee7eaed4d858df9d89035fe8f252c727
This commit is contained in:
Matt Joras
2019-10-08 12:21:52 -07:00
committed by Facebook Github Bot
parent cff5937685
commit c0a0919113
5 changed files with 102 additions and 26 deletions

View File

@@ -2338,7 +2338,7 @@ TEST_F(QuicTransportTest, WriteStreamFromMiddleOfMap) {
conn.outstandingPackets.clear();
// Start from stream2 instead of stream1
conn.schedulingState.lastScheduledStream = s2;
conn.schedulingState.nextScheduledStream = s2;
writableBytes = kDefaultUDPSendPacketLen - 100;
EXPECT_CALL(*socket_, write(_, _)).WillOnce(Invoke(bufLength));
@@ -2361,7 +2361,7 @@ TEST_F(QuicTransportTest, WriteStreamFromMiddleOfMap) {
conn.outstandingPackets.clear();
// Test wrap around
conn.schedulingState.lastScheduledStream = s2;
conn.schedulingState.nextScheduledStream = s2;
writableBytes = kDefaultUDPSendPacketLen;
EXPECT_CALL(*socket_, write(_, _)).WillOnce(Invoke(bufLength));
writeQuicDataToSocket(