Skip to content
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

Client::PerformRequest dumps response before checking for MaxResponseSize #1647

Open
hazimavdal opened this issue Sep 16, 2022 · 0 comments
Open

Comments

@hazimavdal
Copy link

Which version of Elastic are you using?

[ ] elastic.v7 (for Elasticsearch 7.x)

Please describe the expected behavior

Client::dumpResponse should check for MaxResponseSize before dumping the request similar to what Client::newResponse does. Currently the library can cause subtle OOM situations even if the request is bounded by a MaxResponseSize limit unless the trace logger is also nil.

Consumers should be able to set a trace logger without risking OOMs. At the very least it should be made clear in the documentation that MaxResponseSize must be set and the trace logger must be nil to guard against OOM exceptions.

Please describe the actual behavior

Library can cause OOM exceptions if trace logger is set, regardless of the MaxResponseSize limits.

Any steps to reproduce the behavior?

Instantiate a client and set both the MaxResponseSize and the trace logger to be non-zero valued. You will see that the process will use a lot of memory even if you set the MaxResponseSize to be a low value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant