Commit 4ce979d
committed
fix: IPFS peering never persists, and bitswap hangs even when peered
Two separate bugs were still causing shared storage downloads to
hang/time out intermittently even after the earlier peering fix
(#359):
1. swarm/peering/add returns success but never actually writes to
the on-disk Peering.Peers config - verified directly by checking
the config immediately after calling it. It only registers the
peer with the running daemon's in-memory peering service for that
session. Since first-time setup restarts the IPFS containers
partway through (to apply finalized config), any peering set up
before that restart was silently lost, leaving nodes to fall back
on unreliable mDNS. Switched to POST /api/v0/config to persist
Peering.Peers for real; verified it survives a full container
restart with both nodes reconnecting automatically.
2. Even once genuinely peered, content fetches still hang: this is a
long-standing upstream Kubo/bitswap bug (ipfs/kubo#8346, open
since 2021) where in a small private network, bitswap discovers a
provider via the DHT but never sends it a WANT message if the
swarm connection to that peer already existed - reproduced
directly (bitswap stat showed 0 partners despite an active,
bitswap-protocol-negotiated swarm connection). Routing.Type is now
set to "none" instead of "dht": with no DHT to depend on, bitswap
has no choice but to broadcast wants directly to its connected
peers, which is all a small private swarm needs anyway. Verified
5/5 sequential cross-node fetches plus the HTTP gateway path all
succeed reliably with this change.
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>1 parent 4bfec00 commit 4ce979d
2 files changed
Lines changed: 41 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | | - | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
617 | 623 | | |
| 624 | + | |
618 | 625 | | |
619 | 626 | | |
620 | 627 | | |
621 | 628 | | |
622 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
623 | 638 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
631 | 649 | | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
632 | 655 | | |
633 | 656 | | |
634 | | - | |
| 657 | + | |
635 | 658 | | |
636 | 659 | | |
637 | 660 | | |
| |||
0 commit comments