Skip to content

http: wire ConnectionLifetimeCallbacks into pool connection events#43702

Open
aakugan wants to merge 1 commit intoenvoyproxy:mainfrom
aakugan:lifetimecallbacks-notify
Open

http: wire ConnectionLifetimeCallbacks into pool connection events#43702
aakugan wants to merge 1 commit intoenvoyproxy:mainfrom
aakugan:lifetimecallbacks-notify

Conversation

@aakugan
Copy link
Contributor

@aakugan aakugan commented Mar 1, 2026

Commit Message

http: wire ConnectionLifetimeCallbacks into pool connection events

Description

Wires up the ConnectionLifetimeCallbacks interface that is there but is not connected to actual connection events from what I see at least. The cluster manager now passes the LB's callbacks into each HTTP pool at creation time, and MultiplexedActiveClientBase fires them on Connected, Close, and GOAWAY events.

Primary motivation: allows the reverse tunnel cluster's LB to detect GOAWAY and report it to the tunnel reporter (raw example). Also applicable to DFP clusters for connection coalescing awareness from what I see.

Risk Level

Should be low. Additive-only changes to production code. Callbacks are no-ops unless explicitly set by the LB. No behavior change for existing clusters.

Testing

  • HTTP/2 conn pool unit tests (7 tests): no-op without callbacks, Connected/RemoteClose/LocalClose with arg verification, GOAWAY with active streams, idle GOAWAY, callback replacement.
  • HTTP/3 conn pool unit test: Connected + idle GOAWAY through MultiplexedActiveClientBase.
  • Cluster manager unit tests: verifies setLifetimeCallbacks is called on pool creation.

Docs Changes

N/A

Release Notes

N/A

Signed-off-by: aakugan <aakashganapathy2@gmail.com>
Copy link
Member

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

Added a couple of drive-by comments

}

protected:
OptRef<ConnectionLifetimeCallbacks> callbacks_;
Copy link
Member

Choose a reason for hiding this comment

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

Move all implementation and data out of the interface and into the implementation


// Override to provide the lifetimeCallbacks.
void onEvent(Network::ConnectionEvent event) override {
if (event == Network::ConnectionEvent::Connected ||
Copy link
Member

Choose a reason for hiding this comment

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

Move implementation into .cc file

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.

3 participants