-
Notifications
You must be signed in to change notification settings - Fork 848
Log H2 errors with the codes #5676
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
Conversation
59e7288 to
ee1094a
Compare
proxy/http2/Http2ConnectionState.cc
Outdated
| if (error.msg) { | ||
| Error("HTTP/2 connection error client_ip=%s session_id=%" PRId64 " stream_id=%u %s", client_ip, | ||
| ua_session->connection_id(), stream_id, error.msg); | ||
| Error("HTTP/2 connection error code=%d client_ip=%s session_id=%" PRId64 " stream_id=%u %s", static_cast<int>(error.code), |
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.
Looks okay.
Is it better to convert the code to string to log, so user don't need to search the source to find out what the actual meaning?
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.
Well, I'm ok with using error names instead of codes. I'm not too worried about the log size but a line might get a bit too long, and making consistent length value might be easy to read (the maximum error code is 0x0d if we use hex).
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.
Now it prints error codes in hex decimal. Let me know if you still want it to be a string error name.
37f5b33 to
f2313eb
Compare
masaori335
left a comment
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.
Looks reasonable.
|
[approve ci autest] |
1 similar comment
|
[approve ci autest] |
H2 errors are logged only if they have error messages, and even with the messages, actual error codes are not logged.
We should log all errors with the codes at these places so that we can see what happened. If you don't want to log some particular errors for some reasons, you can skip these logging by passing
nullptras an error message (the default message is an empty string).If everything is working well, amount of logs should not increase.
I'd like to backport this change to older versions because I think this is essential information for troubleshooting.