mirror of https://github.com/linkerd/linkerd2.git
proxy: Record EOS when bodies are dropped (#1003)
It appears that hyper does not necessarily poll bodies to completion, and instead simply drops a body as soon as `content-length` is reached (hyperium/hyper#1521). This change implements Drop for MeasuredBody such that the stream-end event is triggered if it had not been triggered previously. This ensures that response latencies and counts are recorded for HTTP/1 streams. Fixes #994
This commit is contained in:
parent
8c98cde82b
commit
a3cb1e47a2
|
@ -507,6 +507,14 @@ where
|
|||
|
||||
}
|
||||
|
||||
impl<B, I: BodySensor> Drop for MeasuredBody<B, I> {
|
||||
fn drop(&mut self) {
|
||||
if let Some(inner) = self.inner.take() {
|
||||
inner.end(None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===== impl BodySensor =====
|
||||
|
||||
impl BodySensor for ResponseBodyInner {
|
||||
|
|
Loading…
Reference in New Issue