A long-running rc.33 daemon reached OOM with roughly 22 GiB resident and 24 GiB swapped. Live inspection found 40 GiB and 10/20 GiB anonymous container mappings; the active worker stack and tracing metadata identified iroh's scheduled path-open retry loop. In iroh 1.2.0 every failed connection requeues the same path, while each retry visits every connection again. Separate control and data connections multiply the queue geometrically. Vendor the published iroh 1.2.0 source and select it with a workspace Cargo patch. Deduplicate retry admission and cap distinct pending paths at 64, evicting the oldest before inserting a new candidate. Keep the current and next retry batches bounded without combining control/data connections or changing wire protocols, identity derivation, authentication or state. Document source provenance, the live evidence and removal conditions. Upstream PR 4551 merged on October 6, but inspection of the official 1.3.0 crate still shows the unconditional enqueue, so that upgrade alone is not a fix. No version bump, release tag or installed-service change. The default workspace suite includes the exact vendored admission module. Three regressions failed with the original enqueue and pass with the fix: repeated failures across connections, duplicate admission at capacity, and 10,000 distinct candidates with bounded length/capacity and FIFO eviction. Transport integration tests continue using real endpoints and encryption. Checks on Linux in nix develop: - cargo fmt --all -- --check - cargo clippy --locked --workspace --all-targets -- -D warnings - cargo test --locked --workspace --all-targets, with only the inherited TSUNAGI_CONTROL_SOCKET removed from the test environment - git diff --cached --check Initial full-suite runs failed six DNS readiness checks because the inherited system socket path overrode their temporary state directories. Clearing that environment variable resolves those failures without changing application code. Root/network-dependent ignored tests and other operating systems were not run.
121 lines
3.6 KiB
Rust
121 lines
3.6 KiB
Rust
//! Options for creating a report gen client.
|
|
|
|
pub(crate) use imp::Options;
|
|
|
|
#[cfg(not(wasm_browser))]
|
|
mod imp {
|
|
use std::collections::BTreeSet;
|
|
|
|
use url::Url;
|
|
|
|
use crate::net_report::{NetReportConfig, QuicConfig, probes::Probe};
|
|
|
|
/// Options for running probes
|
|
///
|
|
/// By default, will run Https probes.
|
|
///
|
|
/// Use [`Options::quic_config`] to enable QUIC address discovery.
|
|
#[derive(Debug, Clone)]
|
|
pub(crate) struct Options {
|
|
/// The configuration needed to launch QUIC address discovery probes.
|
|
///
|
|
/// If not provided, will not run QUIC address discovery.
|
|
pub(crate) quic_config: Option<QuicConfig>,
|
|
/// TLS config for HTTPS probes.
|
|
pub(crate) tls_config: rustls::ClientConfig,
|
|
/// Proxy to send the HTTP(S) based probes through.
|
|
///
|
|
/// If not provided, the probes connect directly.
|
|
pub(crate) proxy_url: Option<Url>,
|
|
/// User-facing configuration.
|
|
pub(crate) user_config: NetReportConfig,
|
|
}
|
|
|
|
impl Options {
|
|
pub(crate) fn new(tls_config: rustls::ClientConfig) -> Self {
|
|
Self {
|
|
quic_config: None,
|
|
tls_config,
|
|
proxy_url: None,
|
|
user_config: NetReportConfig::default(),
|
|
}
|
|
}
|
|
/// Enable quic probes
|
|
pub(crate) fn quic_config(mut self, quic_config: Option<QuicConfig>) -> Self {
|
|
self.quic_config = quic_config;
|
|
self
|
|
}
|
|
|
|
/// Sets the proxy to send the HTTP(S) based probes through.
|
|
pub(crate) fn proxy_url(mut self, proxy_url: Option<Url>) -> Self {
|
|
self.proxy_url = proxy_url;
|
|
self
|
|
}
|
|
|
|
/// Set the net report configuration.
|
|
pub(crate) fn net_report_config(mut self, config: NetReportConfig) -> Self {
|
|
self.user_config = config;
|
|
self
|
|
}
|
|
|
|
/// Turn the options into set of valid protocols
|
|
pub(crate) fn as_protocols(&self) -> BTreeSet<Probe> {
|
|
let mut protocols = BTreeSet::new();
|
|
if let Some(ref quic) = self.quic_config {
|
|
if quic.ipv4 {
|
|
protocols.insert(Probe::QadIpv4);
|
|
}
|
|
if quic.ipv6 {
|
|
protocols.insert(Probe::QadIpv6);
|
|
}
|
|
}
|
|
if self.user_config.https_probes {
|
|
protocols.insert(Probe::Https);
|
|
}
|
|
protocols
|
|
}
|
|
}
|
|
}
|
|
|
|
#[cfg(wasm_browser)]
|
|
mod imp {
|
|
use std::collections::BTreeSet;
|
|
|
|
use crate::net_report::{NetReportConfig, Probe};
|
|
|
|
/// Options for running probes (in browsers).
|
|
///
|
|
/// Only HTTPS probes are supported in browsers.
|
|
/// These are run by default.
|
|
#[derive(Debug, Clone)]
|
|
pub(crate) struct Options {
|
|
/// User-facing configuration.
|
|
pub(crate) user_config: NetReportConfig,
|
|
}
|
|
|
|
impl Default for Options {
|
|
fn default() -> Self {
|
|
Self {
|
|
user_config: NetReportConfig::default(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Options {
|
|
/// Set the net report configuration.
|
|
pub(crate) fn net_report_config(mut self, config: NetReportConfig) -> Self {
|
|
self.user_config = config;
|
|
self
|
|
}
|
|
|
|
/// Turn the options into set of valid protocols
|
|
pub(crate) fn as_protocols(&self) -> BTreeSet<Probe> {
|
|
let mut protocols = BTreeSet::new();
|
|
if self.user_config.https_probes {
|
|
protocols.insert(Probe::Https);
|
|
}
|
|
protocols
|
|
}
|
|
}
|
|
}
|