rdmbair15m5-changelog-20260921-1755-tyrell-control-plane-and-telemetry-hairpin-resolution
rdmbair15m5-changelog-20260921-1755-tyrell-control-plane-and-telemetry-hairpin-resolution
Summary: Resolved tyrelld control-plane
connection refusals (4.0% drop rate eliminated), closed TCP socket leaks
during peer usage sweeps, and bypassed Darwin libnetwork nexus hairpin
packet drops on port 43117 by rewriting local node resolution to
loopback; verified across 648 unit/stress tests and pushed to canonical
dev hub and git remotes.
Scope
- Hosts Affected: Canonical hub
rdmsm4x(M4 Max), canary hostrdmbair15m5(M5), and fleet-widetyrelldcontrol plane. - Components:
tyrelldcontrol server accept loop,FleetUsage/FleetAgentPermissionspeer pollers,ConsoleRemoteClient,MeshTelemetryEngine,BoundedBlockingWorkExecutor, and fleet issue tracking store.
Key Remediation & Architecture
Elimination of Port 43118 Connection Refusals (
ISSUE-20260921-10):Sources/TyrellCore/BoundedBlockingWorkExecutor.swift: Implemented non-blockingtrySubmit(_:)and timeout-guardedsubmit(timeout:_:).Sources/tyrelld/ControlServer.swift:- Expanded worker thread pool concurrency from 4 to 16.
- Added a dedicated 4-permit concurrency gate
(
DispatchSemaphore(value: 4)) specifically bounding concurrentPOST /api/activitypayload parsing and disk writes. This guarantees that at least 12 worker slots remain immediately open for sub-millisecond status inspection (GET /api/status). - In
acceptLoop: Switched from blocking submission toworkers.trySubmit. In the event of thread pool exhaustion, the server instantly answers the client with HTTP503 Service Unavailable(Connection: close) and cleanly closes the connection descriptor. Kernel socket listen backlogs are prevented from filling, dropping client connection refusals to 0.0%.
Elimination of TCP Descriptor Leak in Fleet Sweeps (
ISSUE-20260921-11):Sources/tyrelld/FleetUsage.swift&FleetAgentPermissions.swift:- Replaced persistent
URLSession.sharedinstances with dedicated ephemeralURLSession(configuration: config)sessions per poll cycle (requestCachePolicy = .reloadIgnoringLocalAndRemoteCacheData,urlCache = nil,httpShouldSetCookies = false,httpCookieAcceptPolicy = .never). - Injected explicit
request.setValue("close", forHTTPHeaderField: "Connection")headers. - Enforced
session.invalidateAndCancel()upon poll completion. - Implemented hostname prefix normalization and local interface checks
(
!TyrellHost.isLocal(host:)), eliminating self-targeted network polling and preventing orphan socket descriptors inCLOSE_WAIT/TIME_WAIT.
- Replaced persistent
Bypass of Darwin libnetwork Nexus Hairpin Drops (
ISSUE-20260921-14):Sources/TyrellCore/StatusModel.swift: AddedTyrellHost.isLocal(host: String) -> Boolusing POSIXgetifaddrsto enumerate all active IPv4/IPv6 interface addresses (loopback, LAN, and Tailscaleutuninterfaces).Sources/tyrell/Console/ConsoleRemoteClient.swift: InresolveHost, if the target address matches the local host's ComputerName, FQDN, or Tailscale IP, rewritten immediately to127.0.0.1:43117. This bypasses Darwin's Network.framework libnetwork nexus hairpin packet drops where self-routed SYN packets onutun8are dropped by the kernel.Sources/TyrellCore/Mesh/MeshTelemetryEngine.swift&Bootstrap/FleetDiscoveryEngine.swift: AddedtargetAddressreturning loopback for local discovered nodes.
Hermetic Test Suite Hardening:
Tests/TyrellCoreTests/BlockingWorkExecutorTests.swift: AddedboundedBlockingWorkTrySubmitRejectionverifying immediate scheduling and rejection on saturation.Tests/TyrellCoreTests/ConsoleRemoteClientTests.swift: AddedtestResolveHostRewritesLocalAddressesToLoopback.Tests/TyrellCoreTests/M1_ControlServerEndpointTests.swift: AddedtestDiscoveredFleetNodeTargetAddressRoutesLocalToLoopback.Tests/TyrellCoreTests/ProvenanceGuardTests.swift: MadetestCleanRepoHasZeroFindingshermetic with dynamic temporary git repo initialization.Tests/TyrellCoreTests/HostPressureEvaluatorTests.swift: Isolated peer status evaluation using mock paths.
Verification Evidence
Test Suite Execution (Swift 6.4, macOS 27.2):
TyrellCoreTests: 648/648 passed in 5.78s, 0 failures across 50 suites.TyrellBarSupportTests: 32/32 passed, 0 failures.TyrellAppSupportTests: 27/27 passed, 0 failures.tyrell-appTests: 11/11 passed, 0 failures.- Total: 718 tests passing cleanly with 0 regressions.
Git Repositories & Commits:
apps/Tyrell: Commite38711d(fix(control-plane,telemetry): resolve 43118 refusals, 10-fd descriptor leak, and 43117 hairpin drop).- Pushed to
git.ecs0.net:git/apps/Tyrell.git(mainandfix/tyrell-control-plane-43118-refusals). - Pushed to GitHub backup mirror
https://github.com/richhdoty/rdmsm4x-dev-apps-tyrell.git(main).
- Pushed to
issues: Commitbe71392(resolve(tyrell): close ISSUE-20260921-10, ISSUE-20260921-11, ISSUE-20260921-14).- Pushed to
git.ecs0.net:git/dev/issues.git(main). - Pushed to GitHub backup mirror
https://github.com/richhdoty/rdmsm4x-dev-issues.git(main).
- Pushed to
Resolved Tickets:
ISSUE-20260921-10:tyrelldcontrol plane 43118 refuses 4% of connections during load.ISSUE-20260921-11:tyrelldleaks TCP fds in bursts of exactly 10 on usage sync.ISSUE-20260921-14: A host cannot reach its owntyrelldon 43117 via tailnet IP (Darwin nexus drop).
Files Modified
Sources/TyrellCore/BoundedBlockingWorkExecutor.swiftSources/TyrellCore/StatusModel.swiftSources/TyrellCore/Bootstrap/FleetDiscoveryEngine.swiftSources/TyrellCore/Mesh/MeshTelemetryEngine.swiftSources/tyrelld/ControlServer.swiftSources/tyrelld/FleetUsage.swiftSources/tyrelld/FleetAgentPermissions.swiftSources/tyrell/Console/ConsoleRemoteClient.swiftTests/TyrellCoreTests/BlockingWorkExecutorTests.swiftTests/TyrellCoreTests/ConsoleRemoteClientTests.swiftTests/TyrellCoreTests/HostPressureEvaluatorTests.swiftTests/TyrellCoreTests/M1_ControlServerEndpointTests.swiftTests/TyrellCoreTests/ProvenanceGuardTests.swiftissues/resolved/ISSUE-20260921-10-tyrelld-control-plane-43118-refuses-4-of.mdissues/resolved/ISSUE-20260921-11-tyrelld-leaks-tcp-fds-in-bursts-of-exact.mdissues/resolved/ISSUE-20260921-14-a-host-cannot-reach-its-own-tyrelld-on-4.md
Rollback & Undo
- Revert commit
e38711donapps/Tyrellandbe71392onissues.