envoyproxy / envoyproxy/envoy

Refactor doEndStream in HCM

Open
#8,497 0 comments 0 reactions 0 assignees View on GitHub
help wanted tech debt
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
437

Description

The `doEndStream` in the HttpConnectionManager is somewhat misleading because it is only called for some code paths that result in a stream being shut down (including the happy path).

We should consider refactoring this code to make this easier to understand, perhaps by ensuring that this cleanup code is always called on stream end: this would help centralize any cleanup code, including calling deferred delete.

Another option would be to rename the function to make its intent clearer: it currently tries to figure out if the downstream should be reset and handles updating `drain_state_`, which is not easily inferable from its current name.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.