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

Notify connection callback when app rate limited

Summary:
Notify connection callback implementation when the transport becomes app rate limited
- The callback implementation is not required to define a handler for this callback (not pure virtual).
- D21923745 will add an instrumentation callback class that can be used to allow other components to receive this signal. I'm extending to the connection callback because the overhead seems low, and we already have the connection callback registered for `HQSession`.

Reviewed By: mjoras, lnicco

Differential Revision: D21923744

fbshipit-source-id: 153696aefeab82b7fd8a6bc299c011dcce479995
This commit is contained in:
Brandon Schlinker
2020-07-16 10:23:35 -07:00
committed by Facebook GitHub Bot
parent 9dd5d81d8e
commit e43eb2e8b4
4 changed files with 11 additions and 0 deletions

View File

@@ -280,6 +280,7 @@ TEST_F(QuicTransportTest, NotAppLimitedWithLoss) {
false,
nullptr);
EXPECT_CALL(*rawCongestionController, setAppLimited()).Times(0);
EXPECT_CALL(connCallback_, onAppRateLimited()).Times(0);
loopForWrites();
transport_->close(folly::none);
}
@@ -307,6 +308,7 @@ TEST_F(QuicTransportTest, NotAppLimitedWithNoWritableBytes) {
false,
nullptr);
EXPECT_CALL(*rawCongestionController, setAppLimited()).Times(0);
EXPECT_CALL(connCallback_, onAppRateLimited()).Times(0);
loopForWrites();
transport_->close(folly::none);
}
@@ -325,6 +327,7 @@ TEST_F(QuicTransportTest, NotAppLimitedWithLargeBuffer) {
auto buf = buildRandomInputData(100 * 2000);
transport_->writeChain(stream, buf->clone(), false, false, nullptr);
EXPECT_CALL(*rawCongestionController, setAppLimited()).Times(0);
EXPECT_CALL(connCallback_, onAppRateLimited()).Times(0);
loopForWrites();
transport_->close(folly::none);
}
@@ -347,6 +350,7 @@ TEST_F(QuicTransportTest, AppLimited) {
false,
nullptr);
EXPECT_CALL(*rawCongestionController, setAppLimited()).Times(1);
EXPECT_CALL(connCallback_, onAppRateLimited()).Times(1);
loopForWrites();
transport_->close(folly::none);
}