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

[Netty 5] Use Java8 as minimum Java version #8540

Closed
normanmaurer opened this issue Nov 13, 2018 · 15 comments
Closed

[Netty 5] Use Java8 as minimum Java version #8540

normanmaurer opened this issue Nov 13, 2018 · 15 comments

Comments

@normanmaurer
Copy link
Member

Netty 5 will move to Java 11 as minimum.

This is driven by the fact that we assume that the development of Netty 5 will take some time and for people that can not switch to Java11 there will still be support for netty 4.1.

@smaldini
Copy link

Bold but interesting choice ! Java 11 is far from mainstream but it is all relative to 5.0 timeline as well so I am not too worried. We can still evaluate by then if we really needed any Java 9-11 API to achieve what we want. It seems that Finalizer/Cleaner/RefCounted might be one.

I believe the non Java 8 API tho will be pretty limited but if that happens, I wonder if we should have a 4.2 both introducing new features/changes, along with deprecations and requiring Java 8 only.

@normanmaurer
Copy link
Member Author

@smaldini sounds fair enough... That said I can at least think of two things that are interesting for us which are both not in Java8.

@smaldini
Copy link

smaldini commented Nov 13, 2018

Yeah so we need to look at AsciiString vs String but that seems like a small price to pay to keep compat if it was the only thing. That's up for debate tho.
About finalize() I would hope we could get away without using them. Implicit behavior depending on non deterministic GC behavior seems dangerous enough that maybe the best way would be to require explicit releasing. It seems to be doable with 4 use cases: HashedWheelTimer, OpenSslContext, OpenSslEngineand PoolArena. One use case is more tricky because leaky : Recycler. We already educate users to pay attention to ReferenceCounted#release calls and management of event loop / pool resources so it shouldn't be too far a gap to maybe transition to explicit behavior here too.

@ejona86
Copy link
Member

ejona86 commented Nov 14, 2018

Java 11 may be a bit too aggressive for gRPC to use it soon, as we may need to support "the last two LTS releases." That would mean it'd be 3 years from now before gRPC could use Netty 5. Our support timelines are still a bit up-in-the-air, though.

@smaldini, #8052 will likely resolve the Recycler issue. But I don't think we could remove all usages, for example, leak detector. Although maybe we can make such things optional and then use Cleaner or ObjectCleanerThread. Or may also be possible to fake an API like Cleaner using a custom class with finalizer(). Or just periodically poll a ReferenceQueue when registering new objects to be watched. I do agree this is a reasonable risk to using Java 8.

Concerning Compact strings/AsciiString, I think it would be fair to say, "if you want Netty to be more efficient, use Java 11." As in, we can still design for preference of Java 11+ without dropping Java 8, and it's not even difficult to do so in this case.

@SharpMan
Copy link

SharpMan commented Nov 17, 2018

I would have understood choosing JDK10 for Http/2 features, but you guys went straight from the goal of Java 8 to 11 ?
Did the community had any word on this ?
Although , Java11 does support tls1.3, I think the project will go through the longest ever unstable version.

@normanmaurer
Copy link
Member Author

@SharpMan none of the things here is written in stone and just suggestions. We would love to hear suggestions from the community

@winterbe
Copy link

@SharpMan HTTP Client has changed from JDK 10 to 11. In Java 10 it was only available from jdk.incubator package. You shouldn’t build a library on top of that API.

@johnou
Copy link
Contributor

johnou commented Nov 25, 2018

@SharpMan I think you'll find Netty 4.x is Java 6. Java 11 is also the next LTS.

@SharpMan
Copy link

SharpMan commented Dec 22, 2018

l find Netty 4.x is Java 6. Java 11 is also the next LTS.

So everyone has to deal with commercial licenses 👏

@SharpMan none of the things here is written in stone and just suggestions. We would love to hear suggestions from the community

JDK 9 Issues
JDK 10 Issues

Netty has to complete solving issues related to previous JDK versions in order to aim for the new java version. All the features mentioned on the Netty 5 report will take 2-3 years to be tested and released. So if we add the estimated time to fix JDK11 issues, it would take forever.
It is for the best of Netty to remain running on JDK8 minimal version, otherwise this project will just become a mess.

@Mr00Anderson
Copy link
Contributor

Mr00Anderson commented Jan 23, 2019

Advancing Java Version
Pros:

Cons:

  • Java direct buffer allocation is slower on reading then the Unsafe direct buffer allocation. Though I have not seen if the read performance has increased on ByteBuffer.allocateDirect() in future versions of Java.

@normanmaurer
Copy link
Member Author

So far we did not find any requirement for Java 11 but can life with Java 8 as minimum requirement. Let me close this one and update the title to reflect that we use Java8 as a minimum

Netty 5 automation moved this from To do to Done Oct 23, 2019
@normanmaurer normanmaurer changed the title [Netty 5] Use Java11 as minimum Java version [Netty 5] Use Java8 as minimum Java version Oct 23, 2019
@fabienrenaud
Copy link
Contributor

@normanmaurer #8838 is slated for Netty 5 and requires Java 11

@johnou
Copy link
Contributor

johnou commented Jan 9, 2020

@fabienrenaud doesn't require Java 11, it can be optional.

rdesgroppes added a commit to rdesgroppes/netty that referenced this issue Nov 25, 2021
Motivation:

The workaround introduced by netty#203 (completed by netty#5644) on bug
[JDK-6427854](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6427854)
turns out to be no longer applicable since Java 1.7.

Only first few builds of JDK 7 were affected by the bug, which got
fixed in **build 8**. Since JDK 7 was feature complete in
[build 123](https://blogs.oracle.com/java/post/jdk-7-feature-complete),
there's no need to therefore apply the workaround since Java 1.7.

Modifications:

This commit makes sure the workaround (consisting in setting the system
property `sun.nio.ch.bugLevel` to an empty string unless defined)
doesn't get applied when the detected Java version is greater than or
equal to 1.7.

Result:

The workaround gets only applied for Java versions strictly prior to 1.7.

Conditioning the workaround to the Java version will incidentally help
get rid of it when bumping up the minimum JDK support as proposed in
various issues s.a. netty#8259 and netty#8540.
normanmaurer pushed a commit that referenced this issue Nov 26, 2021
Motivation:

The workaround introduced by #203 (completed by #5644) on bug
[JDK-6427854](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6427854)
turns out to be no longer applicable since Java 1.7.

Only first few builds of JDK 7 were affected by the bug, which got
fixed in **build 8**. Since JDK 7 was feature complete in
[build 123](https://blogs.oracle.com/java/post/jdk-7-feature-complete),
there's no need to therefore apply the workaround since Java 1.7.

Modifications:

This commit makes sure the workaround (consisting in setting the system
property `sun.nio.ch.bugLevel` to an empty string unless defined)
doesn't get applied when the detected Java version is greater than or
equal to 1.7.

Result:

The workaround gets only applied for Java versions strictly prior to 1.7.

Conditioning the workaround to the Java version will incidentally help
get rid of it when bumping up the minimum JDK support as proposed in
various issues s.a. #8259 and #8540.
@kasobol-msft
Copy link

@normanmaurer It looks like Netty 5's baseline is now JDK 11 #10650 . This issue and referenced PR mention that 4.x line is going to be supported for a time being. Could you please shed some light on the plans for the 4.x? For how long is it going to be supported?

laosijikaichele pushed a commit to laosijikaichele/netty that referenced this issue Dec 16, 2021
Motivation:

The workaround introduced by netty#203 (completed by netty#5644) on bug
[JDK-6427854](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6427854)
turns out to be no longer applicable since Java 1.7.

Only first few builds of JDK 7 were affected by the bug, which got
fixed in **build 8**. Since JDK 7 was feature complete in
[build 123](https://blogs.oracle.com/java/post/jdk-7-feature-complete),
there's no need to therefore apply the workaround since Java 1.7.

Modifications:

This commit makes sure the workaround (consisting in setting the system
property `sun.nio.ch.bugLevel` to an empty string unless defined)
doesn't get applied when the detected Java version is greater than or
equal to 1.7.

Result:

The workaround gets only applied for Java versions strictly prior to 1.7.

Conditioning the workaround to the Java version will incidentally help
get rid of it when bumping up the minimum JDK support as proposed in
various issues s.a. netty#8259 and netty#8540.
laosijikaichele pushed a commit to laosijikaichele/netty that referenced this issue Dec 16, 2021
Motivation:

The workaround introduced by netty#203 (completed by netty#5644) on bug
[JDK-6427854](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6427854)
turns out to be no longer applicable since Java 1.7.

Only first few builds of JDK 7 were affected by the bug, which got
fixed in **build 8**. Since JDK 7 was feature complete in
[build 123](https://blogs.oracle.com/java/post/jdk-7-feature-complete),
there's no need to therefore apply the workaround since Java 1.7.

Modifications:

This commit makes sure the workaround (consisting in setting the system
property `sun.nio.ch.bugLevel` to an empty string unless defined)
doesn't get applied when the detected Java version is greater than or
equal to 1.7.

Result:

The workaround gets only applied for Java versions strictly prior to 1.7.

Conditioning the workaround to the Java version will incidentally help
get rid of it when bumping up the minimum JDK support as proposed in
various issues s.a. netty#8259 and netty#8540.
@normanmaurer
Copy link
Member Author

@kasobol-msft there is not real defined date yet but I am sure it will be quite some time

raidyue pushed a commit to raidyue/netty that referenced this issue Jul 8, 2022
Motivation:

The workaround introduced by netty#203 (completed by netty#5644) on bug
[JDK-6427854](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6427854)
turns out to be no longer applicable since Java 1.7.

Only first few builds of JDK 7 were affected by the bug, which got
fixed in **build 8**. Since JDK 7 was feature complete in
[build 123](https://blogs.oracle.com/java/post/jdk-7-feature-complete),
there's no need to therefore apply the workaround since Java 1.7.

Modifications:

This commit makes sure the workaround (consisting in setting the system
property `sun.nio.ch.bugLevel` to an empty string unless defined)
doesn't get applied when the detected Java version is greater than or
equal to 1.7.

Result:

The workaround gets only applied for Java versions strictly prior to 1.7.

Conditioning the workaround to the Java version will incidentally help
get rid of it when bumping up the minimum JDK support as proposed in
various issues s.a. netty#8259 and netty#8540.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Netty 5
  
Done
Development

No branches or pull requests

9 participants