-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Record chunked response size before sending last chunk #102586
Record chunked response size before sending last chunk #102586
Conversation
We expect that the HTTP response stats should reflect the responses received by the client, but today we record that a chunked-encoded response was sent _after_ sending the last chunk, which might mean that the client can receive the complete response body and then retrieve stats that do not include that response. With this commit we record the stats before sending the last chunk. Closes elastic#102547
Pinging @elastic/es-distributed (Team:Distributed) |
Calling this a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for fixing it. I am amazed how quickly you spotted the issue. Did you manage to reproduce it or did you just discover it by reading the code?
I spotted that the missing response stats were always the Didn't actually reproduce it, but I imagine it would happen every time with a sufficient delay just before updating the stats. |
We expect that the HTTP response stats should reflect the responses received by the client, but today we record that a chunked-encoded response was sent _after_ sending the last chunk, which might mean that the client can receive the complete response body and then retrieve stats that do not include that response. With this commit we record the stats before sending the last chunk. Closes elastic#102547
We expect that the HTTP response stats should reflect the responses
received by the client, but today we record that a chunked-encoded
response was sent after sending the last chunk, which might mean that
the client can receive the complete response body and then retrieve
stats that do not include that response. With this commit we record the
stats before sending the last chunk.
Closes #102547