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

HTTP API calls hang with 'Accept-Encoding: zstd' #17408

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

reta
Copy link
Collaborator

@reta reta commented Feb 21, 2025

Description

Excluding zstd from the list of default supported compressors: although zstd-jni is on the classpath, ZstdEncoder requires direct buffers supports and which by default NettyAllocator does not provide.

Caused by: java.lang.UnsupportedOperationException: Direct buffers not supported
        at org.opensearch.transport.NettyAllocator$NoDirectBuffers.directBuffer(NettyAllocator.java:289) ~[transport-netty4-client-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at io.netty.handler.codec.compression.ZstdEncoder.handlerAdded(ZstdEncoder.java:182) ~[netty-codec-4.1.118.Final.jar:4.1.118.Final]
        at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:1130) [netty-transport-4.1.118.Final.jar:4.1.118.Final]
        at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:558) [netty-transport-4.1.118.Final.jar:4.1.118.Final]
        ... 147 more

Related Issues

Closes #17339

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@reta reta requested a review from peternied as a code owner February 21, 2025 01:23
@reta reta added the bug Something isn't working label Feb 21, 2025
@github-actions github-actions bot added Other v2.19.1 Issues and PRs related to version 2.19.1 v3.0.0 Issues and PRs related to version 3.0.0 labels Feb 21, 2025
Signed-off-by: Andriy Redko <drreta@gmail.com>
@reta reta added backport 2.x Backport to 2.x branch and removed skip-changelog labels Feb 21, 2025
Copy link
Contributor

❌ Gradle check result for 021c389: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 021c389: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for 021c389: SUCCESS

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 72.48%. Comparing base (abe2333) to head (021c389).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...nsearch/http/netty4/Netty4HttpServerTransport.java 73.33% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17408      +/-   ##
============================================
+ Coverage     72.41%   72.48%   +0.07%     
- Complexity    65667    65672       +5     
============================================
  Files          5303     5303              
  Lines        304781   304793      +12     
  Branches      44201    44202       +1     
============================================
+ Hits         220709   220932     +223     
+ Misses        65959    65770     -189     
+ Partials      18113    18091      -22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@andrross andrross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is the right fix, but should we create an issue to add direct buffer support to NettyAllocator and add an option to use zstd compression here?

@reta
Copy link
Collaborator Author

reta commented Feb 21, 2025

I agree this is the right fix, but should we create an issue to add direct buffer support to NettyAllocator and add an option to use zstd compression here?

Thanks @andrross , I will open up an issue to research why Netty transport uses NoDirectBuffers allocator - it was certainly the deliberate decision. Thank you.

UPD: #17413

@reta reta merged commit ca8e4f8 into opensearch-project:main Feb 21, 2025
57 of 58 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-17408-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ca8e4f871a1cfec70985aa6acea33f0c36484be5
# Push it to GitHub
git push --set-upstream origin backport/backport-17408-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-17408-to-2.x.

reta added a commit to reta/OpenSearch that referenced this pull request Feb 21, 2025
…17408)

Signed-off-by: Andriy Redko <drreta@gmail.com>
(cherry picked from commit ca8e4f8)
reta added a commit to reta/OpenSearch that referenced this pull request Feb 21, 2025
…17408)

Signed-off-by: Andriy Redko <drreta@gmail.com>
(cherry picked from commit ca8e4f8)
reta added a commit that referenced this pull request Feb 21, 2025
Signed-off-by: Andriy Redko <drreta@gmail.com>
(cherry picked from commit ca8e4f8)
andrross pushed a commit that referenced this pull request Feb 21, 2025
Signed-off-by: Andriy Redko <drreta@gmail.com>
(cherry picked from commit ca8e4f8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed bug Something isn't working Other v2.19.1 Issues and PRs related to version 2.19.1 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] HTTP REST API hangs with Accept-Encoding zstd
2 participants