Bound iroh path retries to prevent multi-connection OOM
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.
This commit is contained in:
1 parent
4e235cbac6
commit
2b0c938487
86 files changed
+35810
-3
No files matched your search
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
# Using a local iroh-relay
|
||||
|
||||
It's easy to set up a iroh-relay that runs locally on your machine.
|
||||
|
||||
Using cargo:
|
||||
|
||||
```shell
|
||||
$ cargo run --bin iroh-relay --features="iroh-relay" -- --dev
|
||||
```
|
||||
|
||||
This will bind the iroh-relay to `[::]3340` and run it over HTTP.
|
||||
|
||||
To connect to this iroh-relay when doing your normal iroh commands, adjust the iroh configuration file to read:
|
||||
|
||||
```toml
|
||||
# iroh.config.toml:
|
||||
[[relays]]
|
||||
url = "http://localhost:3340"
|
||||
```
|
||||
|
||||
If you want to give a specific port for the iroh-relay to bind to, you can create a iroh-relay config file and pass that file in using the `--config_path` flag. You need to retain a `secret_key`, so it is recommended to run `iroh-relay --config-path [PATH]` once to generate a secret key and save it to the config file before doing further edits to the file.
|
||||
|
||||
To change the port you want to listen on, change the port in the `addr` field:
|
||||
|
||||
```
|
||||
# iroh-relay.toml
|
||||
|
||||
secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
addr = "[::]:12345"
|
||||
hostname = "my.relay.network"
|
||||
enable_relay = true
|
||||
```
|
||||
|
||||
Check [the iroh-relay file's](../src/bin/iroh-relay.rs) `Config` struct for documentation on each configuration field.
|
||||
|
||||
If you change the local iroh-relay server's configuration, however, be sure to adjust the associated fields in your iroh config as well.
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
# Relays
|
||||
|
||||
When an Iroh endpoint starts up, it does a latency test to see which known relay endpoint it is “closest to”. That relay server is considered the Iroh endpoint's home relay server.
|
||||
|
||||
An endpoint may be connected to multiple relay servers, but it will advertise its home relay endpoint as the one best used to hole-punch or relay packets through.
|
||||
|
||||
You do not need to know an endpoint's relay server in order to connect to them directly, if there are no firewalls or NATs between the two endpoints trying to connect. However, to have any hole punching, you must know at least one relay server to which that endpoint is connected.
|
||||
|
||||
We currently run 3 relays.
|
||||
Reference in new issue
Block a user