Skip to content

Depend on Netty v4.2.2.Final-SNAPSHOT #3705

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/check_graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
transport: [native, nio]
transport: [native, nio, io_uring]
exclude:
# excludes native on Windows (there's none)
- os: windows-2022
transport: native
- os: windows-2022
transport: io_uring
- os: macos-13
transport: io_uring

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -29,5 +33,9 @@ jobs:
with:
distribution: 'graalvm'
java-version: '17.0.12'
- name: Build with Gradle
run: ./gradlew :reactor-netty-graalvm-smoke-tests:nativeTest --no-daemon -PforceTransport=${{ matrix.transport }}
- name: Build and test with Gradle
if: ${{ ! startsWith(matrix.transport, 'io_uring') }}
run: ./gradlew :reactor-netty-graalvm-smoke-tests:nativeTest --no-daemon -PforceTransport=${{ matrix.transport }}
- name: Build and test IO_Uring on Java 17
if: ${{ startsWith(matrix.transport, 'io_uring') }}
run: ./gradlew :reactor-netty-graalvm-smoke-tests:nativeTest -PtestToolchain=17 --no-daemon -PforceTransport=${{ matrix.transport }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Netty SNAPSHOTS
name: Check Reactor Netty 1.2.x with Netty 4.1 SNAPSHOTS

on:
schedule:
Expand All @@ -23,6 +23,8 @@ jobs:

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
ref: '1.2.x'
- name: Set up JDK 1.8
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00
with:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/check_netty_4_2_snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Reactor Netty 1.3.x with Netty 4.2 SNAPSHOTS

on:
schedule:
- cron: "0 14 * * *"
permissions: read-all
jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
transport: [native, nio]
exclude:
# excludes native on Windows (there's none)
- os: windows-2022
transport: native
# macOS - https://github.com/netty/netty/issues/9689
- os: macos-13
transport: native

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Set up JDK 1.8
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
distribution: 'temurin'
java-version: '8'
- name: Set up JDK 17
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
with:
distribution: 'graalvm'
java-version: '17.0.12'
- name: Build with Gradle
run: ./gradlew clean check -x :reactor-netty-core:java17Test --no-daemon -PforceTransport=${{ matrix.transport }} -PforceNettyVersion='4.2.1.Final-SNAPSHOT'
- name: GraalVM smoke tests
run: ./gradlew :reactor-netty-graalvm-smoke-tests:nativeTest --no-daemon -PforceTransport=${{ matrix.transport }} -PforceNettyVersion='4.2.1.Final-SNAPSHOT'
16 changes: 15 additions & 1 deletion .github/workflows/check_transport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2019]
transport: [native, nio]
transport: [native, nio, io_uring]
exclude:
# excludes native on Windows (there's none)
- os: windows-2019
transport: native
- os: windows-2019
transport: io_uring
- os: macos-13
transport: io_uring
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: gradle/actions/wrapper-validation@06832c7b30a0129d7fb559bcc6e43d26f6374244
Expand All @@ -63,7 +67,17 @@ jobs:
distribution: 'temurin'
java-version: '8'
- name: Build and test with Java 8
if: ${{ ! startsWith(matrix.transport, 'io_uring') }}
run: ./gradlew clean check -x :reactor-netty-core:java17Test --no-daemon -x spotlessCheck -PforceTransport=${{ matrix.transport }}
- name: Build and test IO_Uring on Java 17
if: ${{ startsWith(matrix.transport, 'io_uring') }}
run: ./gradlew clean check -x :reactor-netty-core:test -PtestToolchain=17 --no-daemon -x spotlessCheck -PforceTransport=${{ matrix.transport }}
- name: Build and test UDS with NIO on Java 17
if: ${{ ! startsWith(matrix.os, 'windows') }}
run: ./gradlew reactor-netty-http:test --tests reactor.netty.http.server.HttpServerTests.testHttpServerWithDomainSockets_HTTP11Post -PtestToolchain=17 --no-daemon -x spotlessCheck -PforceTransport=nio
- name: Archive tests output
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: tests_output_${{ matrix.os }}_${{ matrix.transport }}
path: reactor-netty-http/build/test-results/test/binary/output.bin
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ ext {
logbackVersion = '1.2.13'

// Netty
nettyDefaultVersion = '4.1.121.Final'
nettyDefaultVersion = '4.2.2.Final-SNAPSHOT'
if (!project.hasProperty("forceNettyVersion")) {
nettyVersion = nettyDefaultVersion
}
Expand Down Expand Up @@ -138,7 +138,7 @@ ext {
reflectionsVersion = '0.10.2'
errorproneCoreVersion = '2.10.0'
errorproneGuavaVersion = '30.0-jre'
bouncycastleVersion = '1.70'
bouncycastleVersion = '1.80'

// Antora
antoraPluginVersion = '1.0.0'
Expand All @@ -149,7 +149,7 @@ ext {
// javadoc: warning - Error fetching URL: https://www.reactive-streams.org/reactive-streams-1.0.4-javadoc/
"https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/",
"https://projectreactor.io/docs/core/release/api/",
"https://netty.io/4.1/api/",
"https://netty.io/4.2/api/",
"https://projectreactor.io/docs/netty/release/api/",
"https://javadoc.io/doc/io.netty.incubator/netty-incubator-codec-classes-quic/latest/"] as String[]
}
Expand Down Expand Up @@ -203,6 +203,7 @@ subprojects {
apply from: "${rootDir}/gradle/setup.gradle"
apply from: "${rootDir}/gradle/javadoc.gradle"
apply from: "${rootDir}/gradle/errorprone.gradle"
apply from: "${rootDir}/gradle/toolchains.gradle"


java {
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ asciidoc:
core-source-link: '{reactor-netty-github-repo}/reactor-netty-core/src/main/java'
http-source-link: '{reactor-netty-github-repo}/reactor-netty-http/src/main/java'
javadoc: 'https://projectreactor.io/docs/netty/{project-version}/api'
nettyjavadoc: 'https://netty.io/4.1/api'
nettyjavadoc: 'https://netty.io/4.2/api'
author:
- Stephane Maldini
- Violeta Georgieva
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It has transitive dependencies on:

* Reactive Streams v1.0.4
* Reactor Core v3.x
* Netty v4.1.x
* Netty v4.2.x

[[getting-started-understanding-bom]]
== Understanding the BOM and versioning scheme
Expand Down
6 changes: 5 additions & 1 deletion gradle/javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ if (project.name == 'reactor-netty-examples' || project.name == 'reactor-netty-g
}

project.tasks.withType(Javadoc) {
javadocTool = javaToolchains.javadocToolFor {
languageVersion = JavaLanguageVersion.of(17)
}

dependsOn jar
group = "Reactor Netty Javadoc"

Expand All @@ -29,13 +33,13 @@ project.tasks.withType(Javadoc) {
failOnError = true

options {
source = "1.8"
addStringOption('Xdoclint:none', '-quiet')
addStringOption('charSet', 'UTF-8')
memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
author = true
header = "${project.name}"
overview = "$rootDir/docs/api/overview.html"
stylesheetFile = file("$rootDir/docs/api/stylesheet.css")
links(rootProject.ext.javadocLinks)
}

Expand Down
17 changes: 11 additions & 6 deletions reactor-netty-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ext {
"Export-Package" : "reactor.netty*;version=$osgiVersion;-noimport:=true",
"Import-Package": [
"!javax.annotation",
"io.netty.channel.kqueue;resolution:=optional;version=\"[4.1,5)\"",
"io.netty.channel.kqueue;resolution:=optional;version=\"[4.2,5)\"",
"io.netty.channel.uring;resolution:=optional;version=\"[4.2,5)\"",
"io.netty.incubator.channel.uring;resolution:=optional",
"io.micrometer.*;resolution:=optional",
"*"
Expand All @@ -53,6 +54,7 @@ sourceSets {
}

configurations {
java17CompileOnly.extendsFrom(compileOnly)
java17Implementation.extendsFrom(implementation)
shaded
contextPropagationTestImplementation.extendsFrom(implementation)
Expand Down Expand Up @@ -85,9 +87,10 @@ dependencies {
compileOnly "io.netty:netty-transport-native-epoll:$nettyVersion"
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
testImplementation "io.netty:netty-transport-native-epoll:$nettyVersion"
testImplementation "io.netty:netty-transport-native-kqueue:$nettyVersion"
testImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
testImplementation "io.netty:netty-transport-native-io_uring:$nettyVersion"
//now we explicitly add correctly qualified native, or do nothing if we want to test NIO
if (forceTransport == "native") {
if (osdetector.os == "osx") {
Expand All @@ -98,19 +101,20 @@ dependencies {
}
}
else if (forceTransport == "io_uring" && osdetector.os == "linux") {
testImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion$os_suffix"
testImplementation "io.netty:netty-transport-native-io_uring:$nettyVersion$os_suffix"
}
else if (forceTransport != "nio") {
throw new InvalidUserDataException("invalid -PforceTranport option " + forceTransport + ", should be native|nio")
throw new InvalidUserDataException("invalid -PforceTransport option " + forceTransport + ", should be native|nio|io_uring")
}
}
else {
//classic build to be distributed
api "io.netty:netty-transport-native-epoll:$nettyVersion:linux-x86_64"
compileOnly "io.netty:netty-transport-native-kqueue:$nettyVersion"
compileOnly "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
compileOnly "io.netty:netty-transport-native-io_uring:$nettyVersion"
testImplementation "io.netty:netty-transport-native-kqueue:$nettyVersion"
testImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:$nettyIoUringVersion"
testImplementation "io.netty:netty-transport-native-io_uring:$nettyVersion"
}

//Metrics
Expand Down Expand Up @@ -140,14 +144,15 @@ dependencies {
testImplementation "io.projectreactor.tools:blockhound-junit-platform:$blockHoundVersion"
testImplementation "io.micrometer:micrometer-core:$micrometerVersion"
testImplementation "org.reflections:reflections:$reflectionsVersion"
testImplementation "io.netty:netty-pkitesting:$nettyVersion"

testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junitPlatformLauncherVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly "org.slf4j:jcl-over-slf4j:$slf4jVersion"

if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
// Necessary for generating SelfSignedCertificate on Java version >= 15
testRuntimeOnly "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
testRuntimeOnly "org.bouncycastle:bcpkix-jdk18on:$bouncycastleVersion"
}

testFixturesApi("ch.qos.logback:logback-classic:$logbackVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoop;
import io.netty.channel.IoEventLoop;
import io.netty.channel.nio.NioEventLoop;
import io.netty.channel.nio.NioIoHandle;
import io.netty.handler.ssl.SslHandler;
import io.netty.handler.stream.ChunkedWriteHandler;
import io.netty.handler.timeout.IdleState;
Expand Down Expand Up @@ -449,15 +452,17 @@ static void addHandlerAfterReactorCodecs(Connection context, String
}
}

@SuppressWarnings("deprecation")
static boolean mustChunkFileTransfer(Connection c, Path file) {
// if channel multiplexing a parent channel as an http2 stream
if (c.channel().parent() != null && c.channel().parent().pipeline().get(NettyPipeline.H2MultiplexHandler) != null) {
return true;
}
ChannelPipeline p = c.channel().pipeline();
EventLoop eventLoop = c.channel().eventLoop();
return p.get(SslHandler.class) != null ||
p.get(NettyPipeline.CompressionHandler) != null ||
(!(c.channel().eventLoop() instanceof NioEventLoop) &&
(((eventLoop instanceof IoEventLoop && !((IoEventLoop) eventLoop).isCompatible(NioIoHandle.class)) || !(eventLoop instanceof NioEventLoop)) &&
!"file".equals(file.toUri().getScheme()));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2022 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2011-2025 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,11 +19,15 @@

import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.IoEventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.epoll.Epoll;
import io.netty.channel.epoll.EpollDatagramChannel;
import io.netty.channel.epoll.EpollDomainDatagramChannel;
import io.netty.channel.epoll.EpollDomainSocketChannel;
import io.netty.channel.epoll.EpollEventLoopGroup;
import io.netty.channel.epoll.EpollIoHandle;
import io.netty.channel.epoll.EpollIoHandler;
import io.netty.channel.epoll.EpollServerDomainSocketChannel;
import io.netty.channel.epoll.EpollServerSocketChannel;
import io.netty.channel.epoll.EpollSocketChannel;
Expand Down Expand Up @@ -90,15 +94,17 @@ public String getName() {

@Override
public EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) {
return new EpollEventLoopGroup(threads, factory);
return new MultiThreadIoEventLoopGroup(threads, factory, EpollIoHandler.newFactory());
}

@Override
@SuppressWarnings("deprecation")
public boolean supportGroup(EventLoopGroup group) {
if (group instanceof ColocatedEventLoopGroup) {
group = ((ColocatedEventLoopGroup) group).get();
}
return group instanceof EpollEventLoopGroup;
return (group instanceof IoEventLoopGroup && ((IoEventLoopGroup) group).isCompatible(EpollIoHandle.class)) ||
group instanceof EpollEventLoopGroup;
}

static final Logger log = Loggers.getLogger(DefaultLoopEpoll.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2018-2025 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,11 +19,15 @@

import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.IoEventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.kqueue.KQueue;
import io.netty.channel.kqueue.KQueueDatagramChannel;
import io.netty.channel.kqueue.KQueueDomainDatagramChannel;
import io.netty.channel.kqueue.KQueueDomainSocketChannel;
import io.netty.channel.kqueue.KQueueEventLoopGroup;
import io.netty.channel.kqueue.KQueueIoHandle;
import io.netty.channel.kqueue.KQueueIoHandler;
import io.netty.channel.kqueue.KQueueServerDomainSocketChannel;
import io.netty.channel.kqueue.KQueueServerSocketChannel;
import io.netty.channel.kqueue.KQueueSocketChannel;
Expand Down Expand Up @@ -89,15 +93,17 @@ public String getName() {

@Override
public EventLoopGroup newEventLoopGroup(int threads, ThreadFactory factory) {
return new KQueueEventLoopGroup(threads, factory);
return new MultiThreadIoEventLoopGroup(threads, factory, KQueueIoHandler.newFactory());
}

@Override
@SuppressWarnings("deprecation")
public boolean supportGroup(EventLoopGroup group) {
if (group instanceof ColocatedEventLoopGroup) {
group = ((ColocatedEventLoopGroup) group).get();
}
return group instanceof KQueueEventLoopGroup;
return (group instanceof IoEventLoopGroup && ((IoEventLoopGroup) group).isCompatible(KQueueIoHandle.class)) ||
group instanceof KQueueEventLoopGroup;
}

static final Logger log = Loggers.getLogger(DefaultLoopKQueue.class);
Expand Down
Loading
Loading