Remove spdyMode from HTTP2PriorityQueue

Summary: Not used.

Reviewed By: hanidamlaj

Differential Revision: D70569309

fbshipit-source-id: be206ae54dc0fef828cfb5931df3ba9121b7b770
This commit is contained in:
Matt Joras 2025-03-06 16:09:19 -08:00 committed by Facebook GitHub Bot
parent 92857bc9e1
commit ea24e8ad1d
4 changed files with 5 additions and 41 deletions

View File

@ -643,7 +643,7 @@ bool HTTP2PriorityQueue::nextEgressResult(HTTP2PriorityQueue& queue,
}
void HTTP2PriorityQueue::nextEgress(
HTTP2PriorityQueue::NextEgressResult& result, bool spdyMode) {
HTTP2PriorityQueue::NextEgressResult& result) {
struct WeightCmp {
bool operator()(const std::pair<HTTPTransaction*, double>& t1,
const std::pair<HTTPTransaction*, double>& t2) {
@ -671,19 +671,6 @@ void HTTP2PriorityQueue::nextEgress(
}
pendingNodes.pop_front();
}
// In SPDY mode, we stop as soon one level of the tree produces results,
// then normalize the ratios.
if (spdyMode && !result.empty() && !pendingNodesTmp.empty()) {
double totalRatio = 0;
for (auto& txnPair : result) {
totalRatio += txnPair.second;
}
CHECK_GT(totalRatio, 0);
for (auto& txnPair : result) {
txnPair.second = txnPair.second / totalRatio;
}
break;
}
std::swap(pendingNodes, pendingNodesTmp);
} while (!stop && !pendingNodes.empty());
std::sort(result.begin(), result.end(), WeightCmp());

View File

@ -161,7 +161,7 @@ class HTTP2PriorityQueue : public HTTP2PriorityQueueBase {
using NextEgressResult = std::vector<std::pair<HTTPTransaction*, double>>;
void nextEgress(NextEgressResult& result, bool spdyMode = false);
void nextEgress(NextEgressResult& result);
static void setNodeLifetime(std::chrono::milliseconds lifetime) {
kNodeLifetime_ = lifetime;

View File

@ -2179,7 +2179,7 @@ unique_ptr<IOBuf> HTTPSession::getNextToSend(bool* cork,
}
toSend = std::min(toSend, connFlowControl_->getAvailableSend());
}
txnEgressQueue_.nextEgress(nextEgressResults_, false);
txnEgressQueue_.nextEgress(nextEgressResults_);
CHECK(!nextEgressResults_.empty()); // Queue was non empty, so this must be
// The maximum we will send for any transaction in this loop
uint32_t txnMaxToSend = toSend * nextEgressResults_.front().second;

View File

@ -120,9 +120,9 @@ class QueueTest : public testing::Test {
std::bind(&QueueTest::visitNode, this, _1, _2, _3, _4), stopFn, true);
}
void nextEgress(bool spdyMode = false) {
void nextEgress() {
HTTP2PriorityQueue::NextEgressResult nextEgressResults;
q_.nextEgress(nextEgressResults, spdyMode);
q_.nextEgress(nextEgressResults);
nodes_.clear();
for (auto p : nextEgressResults) {
nodes_.push_back(std::make_pair(getTxnID(p.first), p.second * 100));
@ -685,29 +685,6 @@ TEST_F(QueueTest, ChromeTest) {
}
}
TEST_F(QueueTest, NextEgressSpdy) {
// 0 and 3 are vnodes representing pri 0 and 1
addTransaction(0, {kRootNodeId, false, 0}, true);
addTransaction(3, {0, false, 0}, true);
// 7 and 9 are pri 0, 11 and 13 are pri 1
addTransaction(7, {0, false, 15});
addTransaction(9, {0, false, 15});
addTransaction(11, {3, false, 15});
addTransaction(13, {3, false, 15});
nextEgress(true);
EXPECT_EQ(nodes_, IDList({{7, 50}, {9, 50}}));
signalEgress(7, false);
nextEgress(true);
EXPECT_EQ(nodes_, IDList({{9, 100}}));
signalEgress(9, false);
nextEgress(true);
EXPECT_EQ(nodes_, IDList({{11, 50}, {13, 50}}));
}
TEST_F(QueueTest, AddOrUpdate) {
q_.addOrUpdatePriorityNode(0, {kRootNodeId, false, 15});
q_.addOrUpdatePriorityNode(3, {kRootNodeId, false, 15});