Skip to content

reverse_tunnel: Add some info logs for tracking downstream conns#45022

Open
aakugan wants to merge 2 commits into
envoyproxy:mainfrom
aakugan:add-logs-downstream
Open

reverse_tunnel: Add some info logs for tracking downstream conns#45022
aakugan wants to merge 2 commits into
envoyproxy:mainfrom
aakugan:add-logs-downstream

Conversation

@aakugan
Copy link
Copy Markdown
Contributor

@aakugan aakugan commented May 12, 2026

Commit Message

reverse_tunnel: Add some info logs for tracking downstream conns

Additional Description

Added some info logs annotated with the node id which makes the lifecycle of the conns more apparent from the logs. More specifically: need to make a conn, making a conn, made a conn / failed to make a conn and the conn accepted by the listener.

Testing

Just logs so the existing unit and integ tests should suffice imo.

Signed-off-by: aakugan <aakashganapathy2@gmail.com>
@aakugan aakugan force-pushed the add-logs-downstream branch from c47fced to 99c21c1 Compare May 12, 2026 05:08

ENVOY_LOG(debug, "reverse_tunnel: RAII IoHandle created with duplicated socket "
"and protection enabled.");
ENVOY_LOG(info, "reverse_tunnel: RAII IoHandle created with duplicated socket for node_id: {}"
Copy link
Copy Markdown
Contributor

@basundhara-c basundhara-c May 12, 2026

Choose a reason for hiding this comment

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

This is a per-request log and we should keep it at debug to prevent log flooding. Per-request logs can have a level > debug only if they indicate an error condition.
For better verbosity while debugging, you can turn on debug logs during testing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@basundhara-c These are per tunnel logs. We should only see max connection_count * worker threads number of logs during envoy process life cycle right?

Copy link
Copy Markdown
Contributor

@basundhara-c basundhara-c May 13, 2026

Choose a reason for hiding this comment

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

It's listener_count * max connection_count * worker threads, right? Do we have an upper bound on the this (the total handshake request count)?
Also, cannot we expose this on stats, that should suffice for debugging?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm the thought process was to use info cuz these are infrequent per listener like ideally once every few odd minutes so should not be a bottleneck + stats imo are not great for this use case as we can cause explosion if we tag with the node id etc and have large number of listeners.

RCConnectionWrapper* wrapper, bool closed) {
ENVOY_LOG(debug, "reverse_tunnel: Connection wrapper done - error: '{}', closed: {}", error,
closed);
ENVOY_LOG(info, "reverse_tunnel: Connection wrapper done - error: '{}', closed: {}, for node_id: {}", error,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above, we cannot turn on info for per-request logs. If there are any other per-request logs we erronnously kept at info in the codebase, we should switch them to debug as well.

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.

5 participants