Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call Complete on SubchannelCallTracker after HttpContent has been disposed #2139

Closed

Conversation

Khazuar
Copy link

@Khazuar Khazuar commented May 22, 2023

Fixes #2133

As described in that issue, the SubchannelCallTracker.Complete method is currently called right after the request headers are sent to the server. This does not actually correspond to the full length of the call, especially in streaming calls.

This change uses a wrapped HttpContent (like here, but only on Dispose) to detect when the user code is actually done with the response data.

I have tested the change with our own application and it behaves as expected. I am aware that it causes some additional allocations and a virtual method call (performance impact), but it's only relevant for users of the ISubchannelCallTracker-interface, which is only used by some (!) custom load balancers. Given that these will not have worked correctly so far, I'd wager the cost acceptable to consider this quick fix for now, and improve on the performance later.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 22, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Khazuar / name: Fabian Grewing (9b5fa3f)

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.

Support streaming calls in the SubchannelCallTracker
2 participants