-
Notifications
You must be signed in to change notification settings - Fork 494
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
fix unexpected EOF when compression is enabled #834
Conversation
Codecov ReportBase: 77.02% // Head: 76.88% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #834 +/- ##
==========================================
- Coverage 77.02% 76.88% -0.14%
==========================================
Files 103 103
Lines 11523 11536 +13
==========================================
- Hits 8876 8870 -6
- Misses 2149 2163 +14
- Partials 498 503 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
pkg/object/httpserver/mux.go
Outdated
@@ -549,7 +549,7 @@ func (mi *muxInstance) serveHTTP(stdw http.ResponseWriter, stdr *http.Request) { | |||
} | |||
err := req.FetchPayload(maxBodySize) | |||
if err == httpprot.ErrRequestEntityTooLarge { | |||
logger.Debugf("%s: %s", mi.superSpec.Name(), err.Error()) | |||
logger.Debugf("%s: %s, you may need to increase 'clientMaxBodySize' or set it to -1", mi.superSpec.Name(), err.Error()) |
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.
should be logged at the level of the ERROR?
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.
I think these messages can be triggered by the client, which means an attacker can generate tons of them.
So I set them all to debug.
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.
use tools like sync.Once to print it once?
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.
using sync.Once
means the user cannot reproduce the error.
I think a better solution is to support adjusting the lowest log level at runtime.
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.
Just a little cost of the I/O, in debug level, the user hard to diagnose the problem. If users switch to output debug, they will pay more cost of I/O and disk.
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.
If we change this one to Error
, we should also change some Debug
s to Error
s, so the I/O cost may not be minimal.
and IMHO, I think 'error' is something unexpected and we cannot handle correctly, while debug
is something we know could happen.
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.
In my understanding, from the user's perspective, it's unexpected, the error was produced by the easegress instead of backend or frontend.
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.
the users couldn't be familiar with the codes like you.
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.
Ok, updated.
when compression is enabled in a
Proxy
, it may fail withio.UnexpectedEOF
and return HTTP 500 to the client.