feat: tunnel state reporting to control plane#362
Conversation
Yourdaylight
commented
Jun 7, 2026
- 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
There was a problem hiding this comment.
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.
a4d5df1 to
95d2b5f
Compare
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
95d2b5f to
197cef8
Compare