| … | … | @@ -675,3 +675,40 @@ Fix: release the slot when the connection's own stream closes, as JS does, |
| 675 | 675 | keeping the 30s timeout as the backstop it should be rather than the primary |
| 676 | 676 | mechanism. Needs a gate that fails N connect attempts at unreachable peers and |
| 677 | 677 | asserts the slots are free before the timeout elapses. |
| 678 | |
| 679 | ### 8.7 The wall fix, verified on the PUBLIC DHT by mutation drill |
| 680 | |
| 681 | `test_handshake_pool.cpp` proves the mechanism in one process. That is not |
| 682 | evidence the daemon works. `daemon/test_daemon_longlived.py` drives 20 real |
| 683 | session-daemons, one at a time, at one long-lived daemon on the public DHT. |
| 684 | |
| 685 | FIXED daemon |
| 686 | peers 1-8 connected : 8/8 (baseline) |
| 687 | peers 17+ connected : 3/4 |
| 688 | pool exhaustion : no |
| 689 | 19 of 20 connected PASS |
| 690 | |
| 691 | MUTATED daemon (_sweep_handshakes commented out of tick) |
| 692 | peers 1-8 connected : 6/8 (baseline) |
| 693 | peers 17+ connected : 0/4 |
| 694 | pool exhaustion : YES |
| 695 | degrades from peer 5 onward FAIL |
| 696 | |
| 697 | The gate exercises the defect and the fix is what separates the two runs. |
| 698 | |
| 699 | ⚠ The mutated run degrades from peer 5, not peer 17. Expected: the host is |
| 700 | joined server AND client, so it ALLOCATES INITIATOR HANDSHAKES TOO. Inbound |
| 701 | peers and its own outbound attempts share the same 16 slots, so the pool fills |
| 702 | well before 16 inbound connections. |
| 703 | |
| 704 | ⚠ Peer 20 was silent in the passing run. A live DHT flakes; the late-peer bar |
| 705 | is deliberately >=1, because 4/4 would make the gate itself unreliable. |
| 706 | |
| 707 | ⛔ Process note, because it nearly shipped a bad binary: while setting up the |
| 708 | drill I saved `daemon/session-daemon` as "FIXED" AFTER it had already been |
| 709 | rebuilt from mutated source, so the two saved copies were the same file. The |
| 710 | results above are unaffected — the passing run predates any mutation, and the |
| 711 | failing run used the mutated build as intended — but "restoring the fixed |
| 712 | binary" restored the broken one. Caught by md5-ing all three; the tracked |
| 713 | binary is now rebuilt from verified-clean source. Copy a binary before you |
| 714 | overwrite it, not after. |