Skip to content

feat: tunnel state reporting to control plane#362

Merged
djylb merged 1 commit into
djylb:masterfrom
Yourdaylight:feat/tunnel-reporting
Jun 10, 2026
Merged

feat: tunnel state reporting to control plane#362
djylb merged 1 commit into
djylb:masterfrom
Yourdaylight:feat/tunnel-reporting

Conversation

@Yourdaylight

Copy link
Copy Markdown
Contributor
  • 60s periodic full tunnel report via reverse WebSocket
  • Real-time tunnel lifecycle events (created/updated/started/stopped/deleted)
  • Service-layer exclusive event emission with local hook capture
  • Standard webapi.Event format with idempotency support
  • Fix: wrapBackgroundLoopStart async goroutine to prevent web server blocking
  • Fix: snapshotTunnelForList clone MaxConn field
  • Fix: use Target.TargetStr instead of deprecated TargetAddr in event payload

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a global management event hook mechanism to centralize tunnel resource mutation events, implements periodic full tunnel state reporting via WebSockets, and adds compatibility tests for control plane configuration parsing. It also fixes a background loop startup block and includes minor updates like tracking MaxConn in tunnel snapshots. Feedback highlights potential data races in emitTunnelEvent due to unsynchronized access to nested tunnel fields, and a potential nil pointer dereference or race condition caused by registering the global event hook before the state object is fully initialized.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread web/service/resources.go
Comment thread web/routers/state.go Outdated
@Yourdaylight Yourdaylight force-pushed the feat/tunnel-reporting branch from a4d5df1 to 95d2b5f Compare June 7, 2026 10:20
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Yourdaylight Yourdaylight force-pushed the feat/tunnel-reporting branch from 95d2b5f to 197cef8 Compare June 9, 2026 12:03
@djylb djylb merged commit 259b7ef into djylb:master Jun 10, 2026
1 check failed
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.

2 participants