Repository navigation
Commit 0bcdcca
Vendor iroh with upstream's hot-fix for the path-open queue
Ayni has been growing until Android kills it, and the cause is upstream and
already known. `RemoteStateActor` re-queues a failed path-open into
`pending_open_paths`, and the 333 ms retry calls `open_path_on_all_conns` for
each entry — which retries the address on *every* connection to that peer, and
every connection still at the path-id cap pushes it back again. One entry
becomes C entries per tick. There is no dedup and no cap.
Two issues are open against it, neither fixed:
#4390 bug, milestone Sprint P. 24 GB single allocation on macOS.
#4509 Windows, RSS past 100 GB, "ALLOCATION FAILURE: 171798691840 bytes".
#4124 closed, the related open_path warning spam.
A comment on #4390 reports it on iOS through iroh-ffi, crashing three times in
six hours "including a couple of network roams (WiFi <-> cellular)" — which is
this application exactly, and connects it to the network-change work in D32.
Measured here with heapprofd on a follower up 54 minutes:
largest SINGLE allocation 834,695,168 bytes (796 MB)
total allocated on stack 1.13 GB in 150 s
That doubling is why it looks like bursts rather than a leak: `grow_amortized`
briefly holds the old buffer and the new one, so RSS jumps and then falls back,
and summing net allocation finds almost nothing. `max(size)` finds it.
iroh 1.2.0 carries identical logic — only a variable renamed — so upgrading does
not help. Checked rather than assumed.
So iroh 1.1.0 is vendored with one deduplicating, capped enqueue, taken verbatim
from the maintainer-facing hot-fix in #4390 so it lifts out cleanly when the
real one lands. `vendor/iroh/DIASWARM-PATCH.md` records all of this and how to
remove it.
**NOT yet claimed as fixed.** Eleven minutes on phone B holds native heap flat at
~87 MB where the unpatched build reached 200 MB by six minutes and 348 MB by
fifteen. But the failure mode is a burst after forty-plus minutes, and this has
twice been called early on windows that were too short. It is under measurement.
`crates/diaswarm-peer` is deliberately left on stock iroh: a control that should
still grow if the patch is what stopped the phones.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent afe202e commit 0bcdcca
88 files changed
Lines changed: 40782 additions & 4 deletions
File tree
- crates
- diaswarm-android
- diaswarm-net
- vendor/iroh
- docs
- examples
- src
- address_lookup
- endpoint
- net_report
- socket
- remote_map
- remote_state
- transports
- relay
- test_utils
- tls
- tests
- patchbay
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments