Skip to main content

exit_forward_path_is_degraded

Function exit_forward_path_is_degraded 

Source
fn exit_forward_path_is_degraded(
    loss_signal: &FrameLossSignal,
    estimator: &AtomicSurbFlowEstimator,
    balancer: &BalancerStateValues,
    recently_stalled: bool,
) -> bool
Expand description

Whether the Exit should report its SURB level faster than its normal period.

Four conditions, all of them required:

  • The forward path is losing frames, or they stall. The Exit’s echo replies are what corroborate a dead relayer’s overdue races. While frames do not reassemble, no reply goes out, and the Entry’s only remaining evidence is this report. Without loss there is nothing to report faster about. A loss is known only once a frame times out, so frames that stalled for SURB_DEGRADED_STALL count as well (recently_stalled, which the driver holds for SURB_DEGRADED_HOLD like a loss): that is the same dark forward path, seconds before its first frame times out.
  • The Entry reads the reports. As PixFillControl::admit decides anyway, but also here: a report to an Entry with no balancer spends a SURB to say nothing, and reporting one per second to it would do so fifteen times as often.
  • The Exit holds an announced SURB target. Without one (a NoRateControl Session, which stores none) the Session never degrades and keeps the normal period: there is no reserve to budget the reports against.
  • The stock is above the keep-alive reserve. This is the budget: at or below the reserve, the normal period is what the Exit can afford, and the reserve is what keeps those reports sendable.