Skip to content

reverse_tunnels: add gRPC streaming client for reverse tunnel reporting#44344

Draft
aakugan wants to merge 3 commits intoenvoyproxy:mainfrom
aakugan:reverse_tunnel_reporting_client
Draft

reverse_tunnels: add gRPC streaming client for reverse tunnel reporting#44344
aakugan wants to merge 3 commits intoenvoyproxy:mainfrom
aakugan:reverse_tunnel_reporting_client

Conversation

@aakugan
Copy link
Copy Markdown
Contributor

@aakugan aakugan commented Apr 9, 2026

BUILDS on #44342. Please review that one first.
INCREMENTAL DIFFS

Commit Message

Add gRPC streaming client for reverse tunnel reporting

Additional Description

Adds a bidirectional gRPC streaming client that pushes reverse tunnel connection state to a remote ReverseTunnelReportingService. This is a client implementation for the EventReporter introduced in the previous PR.

Protocol:

  • On connect (and every reconnect) the client does a full state push of all known connections obtained from the reporter.
  • Between connects the client sends incremental diffs on a periodic send timer. Empty messages serve as heartbeats.
  • Each request carries an incrementing nonce. The server ACKs by echoing the nonce; a NACK carries an error_detail and triggers disconnect.
  • If too many nonces remain unacked the client disconnects and reconnects, treating the server as dead or stuck.
  • The server may adjust the send interval via report_interval in its ACK; the client floors it at 25ms to prevent tight loops.

Key components:

  • GrpcClient: implements ReverseTunnelReporterClient and Grpc::AsyncStreamCallbacks. Manages stream lifecycle, nonce tracking, send/retry timers, and per-cluster stats.
  • GrpcClientFactory: dynamically registered factory resolved by the EventReporter when constructing clients from config.
  • GrpcClientConfig: parsed config struct with defaults (5s send interval, 5s retry, 5 max retries, 1M buffer).

Additional considerations:

  • initialized_ guard prevents silent event queuing if cluster lookup or client creation fails during onServerInitialized().
  • Buffer overflow while disconnected does not re-arm the retry timer.
  • Nonce reset on every new stream to avoid stale ACK confusion.

Risk Level: Low

Testing

Unit tests

Signed-off-by: aakugan <aakashganapathy2@gmail.com>
@aakugan aakugan marked this pull request as draft April 9, 2026 05:43
@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Apr 9, 2026
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @phlax

🐱

Caused by: #44344 was opened by aakugan.

see: more, trace.

@aakugan aakugan force-pushed the reverse_tunnel_reporting_client branch from ccc17ad to 6f80c42 Compare April 9, 2026 05:46
aakugan added 2 commits April 9, 2026 07:02
Signed-off-by: aakugan <aakashganapathy2@gmail.com>
Signed-off-by: aakugan <aakashganapathy2@gmail.com>
@aakugan aakugan force-pushed the reverse_tunnel_reporting_client branch from 6f80c42 to 1586d51 Compare April 9, 2026 07:37
@aakugan aakugan force-pushed the reverse_tunnel_reporting_client branch from 1586d51 to d568b1f Compare April 9, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deps Approval required for changes to Envoy's external dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants