envoyproxy/envoy

Refactor doEndStream in HCM

Open

#8.497 geöffnet am 4. Okt. 2019

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
help wantedtech debt

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

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