Skip to content

Fix native image build when using Netty - #7291

Open
dagnir wants to merge 1 commit into
masterfrom
dongie/netty-native-build-fix
Open

Fix native image build when using Netty#7291
dagnir wants to merge 1 commit into
masterfrom
dongie/netty-native-build-fix

Conversation

@dagnir

@dagnir dagnir commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

NettyNioAsyncHttpClient does not work in GraalVM native images. Requests fail with:

  Caused by: java.util.concurrent.TimeoutException: Acquire operation took longer than 10000 milliseconds.
  	at software.amazon.awssdk.http.nio.netty.internal.HealthCheckedChannelPool.timeoutAcquire(HealthCheckedChannelPool.java:77)

Pooled ByteBuf allocation fails with

  NoClassDefFoundError: Could not initialize class
  io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueue

Exposed by #6968 (released in 2.44.10), which removed the UnpooledByteBufAllocator
workaround for JDK SSL pipelines. That workaround kept TLS pipelines off the pooled
allocator, masking the incompatibility.

Modifications

  • Add --initialize-at-build-time=io.netty.util.internal.shaded.org.jctools to
    netty-nio-client's native-image.properties.

Testing

Verified by building a native-image application using S3 w/ Netty and making a test service call.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@dagnir
dagnir requested a review from a team as a code owner August 18, 2026 22:43
@dagnir
dagnir requested a review from RanVaknin August 18, 2026 22:44
@dagnir dagnir closed this Aug 19, 2026
@dagnir dagnir reopened this Aug 19, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 19, 2026
@dagnir
dagnir enabled auto-merge August 19, 2026 19:28
@dagnir
dagnir added this pull request to the merge queue Aug 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants