GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add unix domain socket transport in netty 4.x via JDK16+ by honglh · Pull Request #13965 · netty/netty

Conversation

@honglh

@honglh honglh commented Apr 10, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation:

Our use case requires using nio transport for unix-domain-socket (UDS) in netty 4.x.
Although netty 5.x supports UDS, it is is not compatible with 4.x. For us and probably many users, having to migrate to 5.x in order to use UDS is not a viable option.

#10991 says it is supported in 5.x and explains the complexity of doing so in 4.x.
Here, I am proposing a simpler way of adding to 4.x using JDK16+ NIO transport.

The simplicity is achieved by allowing NioServerSocketChannel to continue to support INET only and use new classes for UDS.

This UDS support in this (4.x) PR is incompatible with 5.x. But since 5.x is incompatible with 4.x anyway, I don't this is is an issue. It is easy for user to change to use UDS from 5.x when it comes to it.

Thus in summary, this change

  1. Simple to add UDS support in 4.x
  2. Easy to migrate UDS application to 5.x

Modification:

Only a few APIs are overloaded to support NIO UDS class.
Most changes are added new files.

Describe the modifications you've done.

The NioServerSocketChannel and NioSocketChannel supports only INET channels. In this PR mirroring classes for NIO UDS NioDomainServerSocketChannel and NioDomainSocketChannel are added.

I modified EchoServer.java to use newly created NioDomainServerSocketChannel to show the difference creating a EchoServer with INET socket and with UDS socket.

Result:

This is a draft PR, so POM changes to use JDK16+ to build netty-transport are not included.
The EchoServer with UDS works as expected and same as it is using INET

Fixes #.

If there is no issue then describe the changes introduced by this PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

huibinliupush and He-Pin reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@honglh
add nio uds transport
02e2e9a
@honglh honglh changed the title add nio uds transport Add nio uds transport Apr 10, 2024
@honglh honglh mentioned this pull request Apr 11, 2024
Leverage improvements in openjdk 16 #10991
Closed
@honglh honglh changed the title Add nio uds transport Add unix domain socket transport in netty 4.x via JDK16+ Apr 11, 2024
@yawkat

yawkat commented Apr 12, 2024

Copy link
Copy Markdown
Contributor

@chrisvest @normanmaurer

This patch was created by @honglh with some feedback from me. @honglh works for Oracle, though on a different team than me. They want to get the Micronaut HTTP server (and thus netty) working with domain sockets without epoll.

I will help on cleaning up this PR (commit message, compatibility, javadocs, builds, JDK version checks, CLA…) assuming you agree that the general approach is acceptable in netty 4. While this approach is not compatible with the existing kqueue and epoll domain socket implementations (this patch uses the JDK UnixDomainSocketAddress rather than the netty DomainSocketAddress that kqueue and epoll use), I think this tradeoff is reasonable to keep project layout changes to a minimum. Other than that I have no concerns with this approach.

franz1981 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Apr 12, 2024

Copy link
Copy Markdown
Member

@yawkat let me have a look and come back to you early next week

yawkat reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Rework uds impl
53637fc
@normanmaurer

normanmaurer commented Apr 18, 2024

Copy link
Copy Markdown
Member

@honglh @yawkat I pushed some changes which I think makes things more correct and reduces some noise. WDYT ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer added this to the 4.1.110.Final milestone Apr 18, 2024
@normanmaurer

normanmaurer commented Apr 18, 2024

Copy link
Copy Markdown
Member

/cc @chrisvest

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer added 2 commits April 18, 2024 16:58
@normanmaurer
Fix tests
519b920
@normanmaurer
more fixes
a73f2b6
@yawkat

yawkat commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

Thanks @normanmaurer ! Mostly looks fine to me. I've tested it locally and it works, except for the use case we already had a problem with in #13877. When directly constructing a NioDomainServerSocketChannel from a ServerSocketChannel (eg from System.inheritedChannel), and then only registering (not binding) the channel (eg systemd socket activation use case), the channel remains inactive because bound is never set to true. So we probably again either need a setter or pass in the bound value through the constructor.

Another nit: NioDomainServerSocketChannel vs EpollServerDomainSocketChannel, the server and domain are flipped.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Fix naming
eccc80d
@normanmaurer

normanmaurer commented Apr 18, 2024

Copy link
Copy Markdown
Member

@yawkat fixed the naming... let me check what we can do about the "bound" stuff here.

yawkat reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat

yawkat commented Apr 19, 2024

Copy link
Copy Markdown
Contributor

@normanmaurer the link at the bottom of https://docs.google.com/forms/d/e/1FAIpQLSfXTK6SnWWFbR50DFhoZq2floCFOUBH3kG8sZP77im5Rknctg/viewform?formkey=dG9wTmhoeGNGd1MtdFdtVXl4TlVSNlE6MQ to change the list of employees is broken

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Correctly detect if channel is already bound
74f5bd6
@normanmaurer

normanmaurer commented Apr 19, 2024

Copy link
Copy Markdown
Member

@yawkat I just pushed a commit that will allow to correctly detect if a channel was bound before. Also added some tests

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Fix copyright year
814177f
@yawkat

yawkat commented Apr 19, 2024

Copy link
Copy Markdown
Contributor

You haven't

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Apr 19, 2024

Copy link
Copy Markdown
Member

@yawkat 🤦 now I did :D

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
naming
9273ea8
@yawkat

yawkat commented Apr 19, 2024

Copy link
Copy Markdown
Contributor

Thanks! I tried locally, and it works out of the box now.

Otherwise this PR LGTM, we just need to get the CLA sorted on our end.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Apr 19, 2024

Copy link
Copy Markdown
Member

Thanks! I tried locally, and it works out of the box now.

Otherwise this PR LGTM, we just need to get the CLA sorted on our end.

@trustin will fix it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer marked this pull request as ready for review April 19, 2024 16:41
@normanmaurer
normanmaurer requested a review from chrisvest April 19, 2024 16:41
@normanmaurer

normanmaurer commented Apr 19, 2024

Copy link
Copy Markdown
Member

@chrisvest PTAL

chrisvest reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisvest
chrisvest requested changes Apr 19, 2024
View reviewed changes

@chrisvest chrisvest left a comment

Copy link
Copy Markdown
Member

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.

Looks good. I had some comments, though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioServerDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioServerDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioServerDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/main/java/io/netty/channel/socket/nio/NioServerDomainSocketChannel.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread transport/src/test/java/io/netty/channel/socket/nio/NioServerDomainSocketChannelTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
Address comments
6370118
@normanmaurer
normanmaurer requested a review from chrisvest April 20, 2024 13:40
@normanmaurer
Fix test
e965f65
@trustin

trustin commented Apr 22, 2024

Copy link
Copy Markdown
Member

Thanks for your patience, @yawkat. Here's the employee list update form: https://docs.google.com/forms/d/e/1FAIpQLScnQObZBItRc5L9EC_DPB3WVdUA7K_uIgC-I7gxqq3G4JGySQ/viewform

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Apr 22, 2024

Copy link
Copy Markdown
Member

@yawkat @honglh let me know once you think we can pull this in

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yawkat

yawkat commented Apr 22, 2024

Copy link
Copy Markdown
Contributor

Will do, I've sent the CLA upstairs :)

normanmaurer reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer added 3 commits April 22, 2024 11:16
@normanmaurer
Delete file
303dba1
@normanmaurer
Fix version check
60c4d21
@normanmaurer
Address comments
44f24e1
@yawkat

yawkat commented Apr 24, 2024

Copy link
Copy Markdown
Contributor

CLA should be submitted. Note that the Oracle Point of Contact also changed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

violetagg
violetagg approved these changes Apr 24, 2024
View reviewed changes
@normanmaurer
normanmaurer merged commit 420b037 into netty:4.1 Apr 26, 2024
@normanmaurer

normanmaurer commented Apr 26, 2024

Copy link
Copy Markdown
Member

Thanks all !

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer added a commit that referenced this pull request Apr 26, 2024
@honglh @normanmaurer
Add unix domain socket transport in netty 4.x via JDK16+ (#13965)
1851a21
### Motivation:

Our use case requires using nio transport for unix-domain-socket (UDS)
in netty 4.x.
Although netty 5.x supports UDS, it is is not compatible with 4.x. For
us and probably many users, having to migrate to 5.x in order to use UDS
is not a viable option.

### Modification:
Add new classes to support domain UDS with NIO.

### Result:

UDS is supported when using the NIO transport when java 16+ is used.


Co-authored-by: Norman Maurer <[email protected]>
@yawkat

yawkat commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

yawkat added a commit to micronaut-projects/micronaut-core that referenced this pull request May 23, 2024
@yawkat
NIO domain socket support
702dd1e
From netty/netty#13965
@yawkat yawkat mentioned this pull request May 23, 2024
NIO domain socket support micronaut-projects/micronaut-core#10852
Merged
graemerocher pushed a commit to micronaut-projects/micronaut-core that referenced this pull request May 23, 2024
@yawkat @renovate
NIO domain socket support (#10852)
38997d3
* fix(deps): update netty monorepo to v4.1.110.final

* NIO domain socket support
From netty/netty#13965

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@panbingkun panbingkun mentioned this pull request May 26, 2024
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final apache/spark#46744
Closed
LuciferYang pushed a commit to apache/spark that referenced this pull request May 28, 2024
@panbingkun @LuciferYang
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
a88cc1a
### What changes were proposed in this pull request?
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

### Why are the changes needed?
- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([#13965](netty/netty#13965))
  Backport #13075: Add the AdaptivePoolingAllocator ([#13976](netty/netty#13976))
  Add no-value key handling only for form body ([#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
@mkurz mkurz mentioned this pull request Jun 5, 2024
Support Unix domain sockets in Netty backend playframework/playframework#12703
Open
prabhjyotsingh pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 10, 2026
@panbingkun @prabhjyotsingh
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
aad13ee
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
prabhjyotsingh pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 11, 2026
@panbingkun @prabhjyotsingh
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
b638874
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
prabhjyotsingh pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 11, 2026
@panbingkun @prabhjyotsingh
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
093d312
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
Ko-dany pushed a commit to acceldata-io/spark3 that referenced this pull request Sep 11, 2026
@panbingkun @Ko-dany
[SPARK-48420][BUILD] Upgrade netty to 4.1.110.Final
ad24ea9
The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`.

- https://netty.io/news/2024/05/22/4-1-110-Final.html
  This version has brought some bug fixes and improvements, such as:
  Fix Zstd throws Exception on read-only volumes (netty/netty#13982)
  Add unix domain socket transport in netty 4.x via JDK16+ ([apache#13965](netty/netty#13965))
  Backport apache#13075: Add the AdaptivePoolingAllocator ([apache#13976](netty/netty#13976))
  Add no-value key handling only for form body ([apache#13998](netty/netty#13998))
  Add support for specifying SecureRandom in SSLContext initialization ([apache#14058](netty/netty#14058))

- https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed

No.

Pass GA.

No.

Closes apache#46744 from panbingkun/SPARK-48420.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
This was referenced Sep 14, 2026
Http2: Reserve promised stream for PUSH_PROMISE after local RST_STREAM #17471
Closed
cache failure 1233e4a5 #17565
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer left review comments
@violetagg violetagg violetagg approved these changes
@chrisvest chrisvest Awaiting requested review from chrisvest

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.110.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@honglh @yawkat @normanmaurer @trustin @chrisvest @violetagg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.