-
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
Check UTF16 string size before converting to String to avoid OOME #7963
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #7963 +/- ##
============================================
+ Coverage 70.87% 70.91% +0.03%
- Complexity 56904 56908 +4
============================================
Files 4756 4757 +1
Lines 269064 269106 +42
Branches 39392 39396 +4
============================================
+ Hits 190710 190831 +121
+ Misses 62285 62151 -134
- Partials 16069 16124 +55
|
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.
Thanks for adding this!
Few minor comments and we should add a unit test
server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Rishab Nahata <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
libs/core/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
libs/core/src/main/java/org/opensearch/common/bytes/AbstractBytesReference.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Rishab Nahata <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
@Bukhtawar @reta ya'll good with this as is now? |
Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Rishab Nahata <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7963-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 544b1cac97a848479f2355e11e1a2c18b40e8201
# Push it to GitHub
git push --set-upstream origin backport/backport-7963-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
…ensearch-project#7963) * Check UTF16 string size before converting to string to avoid OOME Signed-off-by: Rishab Nahata <[email protected]>
) (#8344) * Check UTF16 string size before converting to string to avoid OOME Signed-off-by: Rishab Nahata <[email protected]>
…ensearch-project#7963) * Check UTF16 string size before converting to string to avoid OOME Signed-off-by: Rishab Nahata <[email protected]>
…ensearch-project#7963) * Check UTF16 string size before converting to string to avoid OOME Signed-off-by: Rishab Nahata <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
Node can drop out for OutOfMemory errors other than the VM OutOfMemory which comes from the implementation limits of StringUTF16.
This PR attempts to pre check the size and throw an exception proactively before trying a conversion.
Related Issues
Resolves #1651
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.