Skip to content

Consume CAN traffic during client startup - #32

Merged
jakthom merged 1 commit into
mainfrom
codex/receive-during-startup
Sep 30, 2026
Merged

jakthom merged 1 commit into
mainfrom
codex/receive-during-startup

Conversation

@jakthom

@jakthom jakthom commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

High-volume CAN traffic could overflow Beacon's 256-message receive buffer while the blocking n2k constructor completed address claiming. Beacon then reconnected and repeated the same startup window.

Upgrade to n2k v1.8.0 and register a scanner with NewUnstartedClient before calling Start. A receive worker drains traffic throughout transport readiness and address claiming; the endpoint becomes up only after startup succeeds. Failed startup closes and joins the receiver, and shutdown cancels pending discovery requests before waiting for them. PGN-list requests wait until the client can transmit.

The dependency upgrade also updates renamed PGN/manufacturer constants and adapts the device-function lookup while preserving unknown-name fallbacks. Existing buffer sizes and overflow behavior remain unchanged; sustained consumer lag can still overflow a subscriber.

Regression coverage delivers 1,024 messages through the existing 256-message buffer during both transport readiness and address claiming, verifies continued delivery on the same connection, checks discovery-request timing, and confirms that last-handle release interrupts startup.

Validation passed:

  • go test ./... -timeout 300s
  • go test -race ./... -timeout 300s
  • go vet ./...
  • just lint
  • just secure
  • CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./...
  • Formatting and git diff --check

Hardware, browser, and Linux vessel resource gates were not run locally. No deployment was performed.

@jakthom
jakthom merged commit 7bdfb08 into main Sep 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant