-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] DeprecationLogger - Unbounded memory usage #16702
Comments
@rajiv-kv Thanks for raising this, definitely an issue. Want to contribute a fix? Maybe a circuit breaker? |
This was introduced in #1660, @VachaShah @andrross we all missed this. I think the map should both have an expiration for its items and be capped in size (in bytes) + be adjustable. |
@dblock I think a fixed-sized LRU cache with no expiration would probably be fine? If you happen to fill up the cache then you start evicting the least recently accessed items, potentially leading to duplicated log messages for those keys. I'd definitely like to avoid the complexity of making it adjustable. We probably don't need to overthink this because the goal is to de-dupe most messages to avoid spamming the log. |
@andrross Yes, the first thing is that it should be bounded so that it doesn't keep on growing. But, I would like to understand the logic behind opaque-id to be appended, if all requests have unique id it doesn't help at all. |
Is there a way for user to see the |
Totally. +1 on not overthinking it. I think the only concern may be with a high TPS, but in that case this whole logger may be pointless. Maybe a setting to turn it off? I'm overthinking it again ...
Yes, the intent was to help the caller who has access to the logs to find where the deprecated requests are coming from, not for the operator to know that a deprecated API is called by someone. It shows this:
|
A [bug][1] was recently identified related to this header that was partly exascerbated by a misuse of the field. We have some documentation related to the [Tasks][2] API for this field, but no general guidance on how to use it. [1]: opensearch-project/OpenSearch#16702 [2]: https://opensearch.org/docs/latest/api-reference/tasks/#attaching-headers-to-tasks Signed-off-by: Andrew Ross <[email protected]>
A [bug][1] was recently identified related to this header that was partly exascerbated by a misuse of the field. We have some documentation related to the [Tasks][2] API for this field, but no general guidance on how to use it. [1]: opensearch-project/OpenSearch#16702 [2]: https://opensearch.org/docs/latest/api-reference/tasks/#attaching-headers-to-tasks Signed-off-by: Andrew Ross <[email protected]>
@dblock @andrross Thanks for updating the documentation and stating the usage of X-Opaque-Id header. But this may not be enough, we need to audit all the official clients like OpenSearch-hadoop to ensure it is used correctly. In case, a user gets into trouble simply because the opensearch clients are mis-using the header, that's not good experience. |
A [bug][1] was recently identified related to this header that was partly exascerbated by a misuse of the field. We have some documentation related to the [Tasks][2] API for this field, but no general guidance on how to use it. [1]: opensearch-project/OpenSearch#16702 [2]: https://opensearch.org/docs/latest/api-reference/tasks/#attaching-headers-to-tasks Signed-off-by: Andrew Ross <[email protected]>
There are many references to X-Opaque-Id, https://github.com/search?q=org%3Aopensearch-project%20X-Opaque-Id&type=code, anyone care to go through them to see if there's problems and open issues? |
* Document the `X-Opaque-Id` header A [bug][1] was recently identified related to this header that was partly exascerbated by a misuse of the field. We have some documentation related to the [Tasks][2] API for this field, but no general guidance on how to use it. [1]: opensearch-project/OpenSearch#16702 [2]: https://opensearch.org/docs/latest/api-reference/tasks/#attaching-headers-to-tasks Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: kolchfa-aws <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: kolchfa-aws <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: kolchfa-aws <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: Andrew Ross <[email protected]> --------- Signed-off-by: Andrew Ross <[email protected]> Co-authored-by: kolchfa-aws <[email protected]> Co-authored-by: Nathan Bower <[email protected]>
* Document the `X-Opaque-Id` header A [bug][1] was recently identified related to this header that was partly exascerbated by a misuse of the field. We have some documentation related to the [Tasks][2] API for this field, but no general guidance on how to use it. [1]: opensearch-project/OpenSearch#16702 [2]: https://opensearch.org/docs/latest/api-reference/tasks/#attaching-headers-to-tasks Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: kolchfa-aws <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: kolchfa-aws <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: kolchfa-aws <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: Andrew Ross <[email protected]> * Update _api-reference/common-parameters.md Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: Andrew Ross <[email protected]> --------- Signed-off-by: Andrew Ross <[email protected]> Co-authored-by: kolchfa-aws <[email protected]> Co-authored-by: Nathan Bower <[email protected]> (cherry picked from commit 1cd69cd) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Describe the bug
DeprecationLogger dedupes messages that has been already logged based on value of
X-Opaque-Id
provided in request.Keys set is maintained in DeprecatedMessage. The entries in set are unbounded and are appended based on the user provided header value
X-Opaque-Id
. In case the user ends up passing unique Opaque-Id per request it can result in OOM on node.Related component
Other
To Reproduce
system-test-index-1
curl -H "X-Opaque-Id: <timestamp-in-milliis>" "https://<endpoint>/_all/_alias/test-alias"
Expected behavior
DeprecatdMessage#keys should be memory bounded and not result in out-of-memory.
Additional Details
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: