-
Notifications
You must be signed in to change notification settings - Fork 579
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
Error logs coming for http: superfluous response.WriteHeader call
when using otelhttp handler
#6053
Error logs coming for http: superfluous response.WriteHeader call
when using otelhttp handler
#6053
Comments
http: superfluous response.WriteHeader call
when using otelhttp handlerhttp: superfluous response.WriteHeader call
when using otelhttp handler
I'm unable to reproduce this running your sample example:
Also, based on stacktrace in the screenshot you're providing, it would appear the superfluous call to |
I can reproduce with the following code -
Output:
go.mod :
|
This if block has been removed in this PR: c619919#diff-cd9dbf33a4742e5cca53d128ebad2d1e61fdc1b41d4978db6d2a3d6a39c4a522L67-L69 |
Hitting this as well #5438 (comment) |
Hitting this too. All those methods that call the real |
The change in #5916 introduced a regression, as we don't check whether the header was written before writing it in `Write()`. We need to only write if the header wasn't written yet. Fixes #6053. --------- Co-authored-by: Tyler Yahn <[email protected]>
I'm getting this same error on otelmux (contrib v0.54.0).
|
This has been fixed in main, and will be available with the next release. |
…emetry#6055) The change in open-telemetry#5916 introduced a regression, as we don't check whether the header was written before writing it in `Write()`. We need to only write if the header wasn't written yet. Fixes open-telemetry#6053. --------- Co-authored-by: Tyler Yahn <[email protected]>
Description
A clear and concise description of what the bug is.
In the latest release the call to request.Write() is setting the response headers to
http.StatusOK
without checking if the WriteHeader is already called, this is causing issues when trying to set Status Codes and then trying to Write to the response.Environment
otelhttp
version: v0.54.0Steps To Reproduce
Expected behavior
The Write() call should check if the wroteHeader is true before calling WriteHeader()
The text was updated successfully, but these errors were encountered: