quic/congestion_control/QuicCubic.cpp
void Cubic::onPersistentCongestion() {
  auto minCwnd = conn_.transportSettings.minCwndInMss * conn_.udpSendPacketLen;
  ssthresh_ = std::max(cwndBytes_ / 2, minCwnd);
  cwndBytes_ = minCwnd;
  if (steadyState_.tcpFriendly) {
    steadyState_.estRenoCwnd = 0;
  }
  steadyState_.lastReductionTime = folly::none;
  steadyState_.lastMaxCwndBytes = folly::none;
  quiescenceStart_ = folly::none;
  hystartState_.found = Cubic::HystartFound::No;
  hystartState_.inRttRound = false;

  state_ = CubicStates::Hystart;

  if (conn_.qLogger) {
    conn_.qLogger->addCongestionMetricUpdate(
        conn_.lossState.inflightBytes,
        getCongestionWindow(),
        kPersistentCongestion,
        cubicStateToString(state_).str());
  }
}
/**
 * TODO: onPersistentCongestion entirely depends on how long a loss period is,
 * not how much a sender sends during that period. If the connection is app
 * limited and loss happens after that, it looks like a long loss period but it
 * may not really be a persistent congestion. However, to keep this code simple,
 * we decide to just ignore app limited state right now.
 */
onPersistentCongestion entirely depends on how long a loss period is,
not how much a sender sends during that period. If the connection is app
limited and loss happens after that, it looks like a long loss period but it
may not really be a persistent congestion. However, to keep this code simple,
we decide to just ignore app limited state right now.
onPersistentCongestion entirely depends on how long a loss period is not how much a sender sends during that period . If the connection is app limited and loss happens after that it looks like a long loss period but it may not really be a persistent congestion . However to keep this code simple we decide to just ignore app limited state right now .
void Cubic::onPersistentCongestion() {
  auto minCwnd = conn_.transportSettings.minCwndInMss * conn_.udpSendPacketLen;
  ssthresh_ = std::max(cwndBytes_ / 2, minCwnd);
  cwndBytes_ = minCwnd;
  if (steadyState_.tcpFriendly) {
    steadyState_.estRenoCwnd = 0;
  }
  steadyState_.lastReductionTime = folly::none;
  steadyState_.lastMaxCwndBytes = folly::none;
  quiescenceStart_ = folly::none;
  hystartState_.found = Cubic::HystartFound::No;
  hystartState_.inRttRound = false;
  state_ = CubicStates::Hystart;
  if (conn_.qLogger) {
    conn_.qLogger->addCongestionMetricUpdate(
        conn_.lossState.inflightBytes,
        getCongestionWindow(),
        kPersistentCongestion,
        cubicStateToString(state_).str());
  }
}
void Cubic :: onPersistentCongestion ( ) { auto minCwnd = conn_ . transportSettings . minCwndInMss * conn_ . udpSendPacketLen ; ssthresh_ = std :: max ( cwndBytes_ / 2 , minCwnd ) ; cwndBytes_ = minCwnd ; if ( steadyState_ . tcpFriendly ) { steadyState_ . estRenoCwnd = 0 ; } steadyState_ . lastReductionTime = folly :: none ; steadyState_ . lastMaxCwndBytes = folly :: none ; quiescenceStart_ = folly :: none ; hystartState_ . found = Cubic :: HystartFound :: No ; hystartState_ . inRttRound = false ; state_ = CubicStates :: Hystart ; if ( conn_ . qLogger ) { conn_ . qLogger -> addCongestionMetricUpdate ( conn_ . lossState . inflightBytes , getCongestionWindow ( ) , kPersistentCongestion , cubicStateToString ( state_ ) . str ( ) ) ; } }
TODO: onPersistentCongestion entirely depends on how long a loss period is,
 not how much a sender sends during that period.
TODO : onPersistentCongestion entirely depends on how long a loss period is not how much a sender sends during that period .