Skip to content

generic proxy: add onDownstreamConnected() callback to ServerCodec#40747

Merged
wbpcode merged 1 commit intoenvoyproxy:mainfrom
kralicky:generic-proxy-downstream-connected
Aug 22, 2025
Merged

generic proxy: add onDownstreamConnected() callback to ServerCodec#40747
wbpcode merged 1 commit intoenvoyproxy:mainfrom
kralicky:generic-proxy-downstream-connected

Conversation

@kralicky
Copy link
Copy Markdown
Contributor

Commit Message: generic proxy: add onDownstreamConnected() callback to ServerCodec
Additional Description:
This adds a new method ServerCodec::onDownstreamConnected() that is called when the downstream connection is established. This can be used for initialization steps that require the connection returned by ServerCodecCallbacks::connection() to have a value and be in a connected state.

Risk Level: Low; the new method has an empty default implementation, as to not break existing ServerCodec implementations.
Testing: Updated unit tests and mocks
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Comment on lines +31 to +37
/**
* Called when the downstream connection is established.
*
* The connection obtained from ServerCodecCallbacks::connection() will be valid when this
* callback is invoked. It should not be relied upon to be valid until this point.
*/
virtual void onDownstreamConnected() {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about just name it onConnected() (simple) or onNewConnection() (keep same with the network filter)?

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.

onConnected() works. I thought the name might be too be ambiguous, but it's probably fine. Naming it onNewConnection() might harm searchability.

Signed-off-by: Joe Kralicky <joekralicky@gmail.com>
@kralicky kralicky force-pushed the generic-proxy-downstream-connected branch from cfd4147 to d131c71 Compare August 18, 2025 18:15
Copy link
Copy Markdown
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@wbpcode wbpcode merged commit 6e335cf into envoyproxy:main Aug 22, 2025
24 checks passed
melginaldi pushed a commit to melginaldi/envoy that referenced this pull request Aug 26, 2025
…nvoyproxy#40747)

Commit Message: generic proxy: add onDownstreamConnected() callback to
ServerCodec
Additional Description:
This adds a new method ServerCodec::onDownstreamConnected() that is
called when the downstream connection is established. This can be used
for initialization steps that require the connection returned by
ServerCodecCallbacks::connection() to have a value and be in a connected
state.

Risk Level: Low; the new method has an empty default implementation, as
to not break existing ServerCodec implementations.
Testing: Updated unit tests and mocks
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: Joe Kralicky <joekralicky@gmail.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
melginaldi pushed a commit to melginaldi/envoy that referenced this pull request Aug 26, 2025
…nvoyproxy#40747)

Commit Message: generic proxy: add onDownstreamConnected() callback to
ServerCodec
Additional Description:
This adds a new method ServerCodec::onDownstreamConnected() that is
called when the downstream connection is established. This can be used
for initialization steps that require the connection returned by
ServerCodecCallbacks::connection() to have a value and be in a connected
state.

Risk Level: Low; the new method has an empty default implementation, as
to not break existing ServerCodec implementations.
Testing: Updated unit tests and mocks
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: Joe Kralicky <joekralicky@gmail.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
wtzhang23 pushed a commit to wtzhang23/envoy that referenced this pull request Aug 27, 2025
…nvoyproxy#40747)

Commit Message: generic proxy: add onDownstreamConnected() callback to
ServerCodec
Additional Description:
This adds a new method ServerCodec::onDownstreamConnected() that is
called when the downstream connection is established. This can be used
for initialization steps that require the connection returned by
ServerCodecCallbacks::connection() to have a value and be in a connected
state.

Risk Level: Low; the new method has an empty default implementation, as
to not break existing ServerCodec implementations.
Testing: Updated unit tests and mocks
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: Joe Kralicky <joekralicky@gmail.com>
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