Description
collect_device_invites defaults ON (internal/config/defaults.go:183) and issues a sequential HTTP call per device inside each devices tick (internal/collector/devices/devices.go:928-933); collect_posture (devices.go:921-926) and services.collect_hosts (internal/collector/services/services.go:174-186) share the shape. On a large tailnet that is thousands of sequential round-trips per tick with no concurrency pool, and a slow API day makes the tick overrun its own interval. Add bounded concurrency and/or an independent longer interval for the subrequest families; consider flipping the invites default off above a fleet-size threshold. Respect the tsapi rate-limit/retry behaviour when parallelizing.
Acceptance Criteria
- #1 Per-device subrequests run under a bounded concurrency pool and/or their own interval
- #2 A tick can no longer overrun its interval solely because of sequential subrequests (test or measured evidence)
- #3 Default posture for large fleets is decided and documented
Definition of Done
- #1 just check passes (the full gate; it is what CI enforces)
- #2 just gen leaves no diff (only if a generated artifact’s inputs changed)
- #3 just –fmt –check passes and every new recipe has a # doc comment and a [group(…)]
Implementation Plan
Root F1 freezes bounded per-device subrequest concurrency with current sequential behaviour preserved by default; lane C later implements pools and timing evidence.
Implementation Notes
Lane C implemented bounded device posture/invite and service host subrequest pools. Default concurrency remains 1 to preserve current sequential behavior; operators opt into bounded parallelism after considering API rate limits. Race tests cover concurrency caps and show parallel work no longer scales linearly with device count.
Final Summary
Added configurable bounded concurrency to per-device and per-service subrequests, concurrent timing coverage preventing sequential interval overruns, and behavior-preserving documented defaults. Implementation SHA 6d9c23c. Final integrated just check passed at 5b55617; exact-head CI run 33354208183 completed success.