Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ public ChannelManager(final AsyncHttpClientConfig config, Timer nettyTimer) {
transportFactory = new EpollTransportFactory();
} else if (isInstanceof(eventLoopGroup, "io.netty.channel.kqueue.KQueueEventLoopGroup")) {
transportFactory = new KQueueTransportFactory();
} else if (isInstanceof(eventLoopGroup, "io.netty.incubator.channel.uring.IOUringEventLoopGroup")) {
transportFactory = new IoUringIncubatorTransportFactory();
} else if (isInstanceof(eventLoopGroup, "io.netty.channel.uring.IOUringEventLoopGroup")) {
transportFactory = new IoUringTransportFactory();
} else {
throw new IllegalArgumentException("Unknown event loop group " + eventLoopGroup.getClass().getSimpleName());
}
Expand All @@ -190,8 +190,8 @@ public ChannelManager(final AsyncHttpClientConfig config, Timer nettyTimer) {
// We will check if Epoll is available or not. If available, return EpollTransportFactory.
// If none of the condition matches then no native transport is available, and we will throw an exception.
if (!PlatformDependent.isWindows()) {
if (IoUringIncubatorTransportFactory.isAvailable() && !config.isUseOnlyEpollNativeTransport()) {
return new IoUringIncubatorTransportFactory();
if (IoUringTransportFactory.isAvailable() && !config.isUseOnlyEpollNativeTransport()) {
return new IoUringTransportFactory();
} else if (EpollTransportFactory.isAvailable()) {
return new EpollTransportFactory();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,31 @@
*/
package org.asynchttpclient.netty.channel;

import io.netty.incubator.channel.uring.IOUring;
import io.netty.incubator.channel.uring.IOUringEventLoopGroup;
import io.netty.incubator.channel.uring.IOUringSocketChannel;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.uring.IoUring;
import io.netty.channel.uring.IoUringIoHandler;
import io.netty.channel.uring.IoUringSocketChannel;

import java.util.concurrent.ThreadFactory;

class IoUringIncubatorTransportFactory implements TransportFactory<IOUringSocketChannel, IOUringEventLoopGroup> {
class IoUringTransportFactory implements TransportFactory<IoUringSocketChannel, MultiThreadIoEventLoopGroup> {

static boolean isAvailable() {
try {
Class.forName("io.netty.incubator.channel.uring.IOUring");
Class.forName("io.netty.channel.uring.IoUring");
} catch (ClassNotFoundException e) {
return false;
}
return IOUring.isAvailable();
return IoUring.isAvailable();
}

@Override
public IOUringSocketChannel newChannel() {
return new IOUringSocketChannel();
public IoUringSocketChannel newChannel() {
return new IoUringSocketChannel();
}

@Override
public IOUringEventLoopGroup newEventLoopGroup(int ioThreadsCount, ThreadFactory threadFactory) {
return new IOUringEventLoopGroup(ioThreadsCount, threadFactory);
public MultiThreadIoEventLoopGroup newEventLoopGroup(int ioThreadsCount, ThreadFactory threadFactory) {
return new MultiThreadIoEventLoopGroup(ioThreadsCount, threadFactory, IoUringIoHandler.newFactory());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package org.asynchttpclient;

import io.github.artsok.RepeatedIfExceptionsTest;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.epoll.EpollEventLoopGroup;
import io.netty.channel.kqueue.KQueueEventLoopGroup;
import io.netty.incubator.channel.uring.IOUringEventLoopGroup;
import io.netty.util.Timer;
import org.asynchttpclient.cookie.CookieEvictionTask;
import org.asynchttpclient.cookie.CookieStore;
Expand Down Expand Up @@ -61,7 +61,7 @@ public void testNativeTransportWithoutEpollOnly() throws Exception {
AsyncHttpClientConfig config = config().setUseNativeTransport(true).setUseOnlyEpollNativeTransport(false).build();
try (DefaultAsyncHttpClient client = (DefaultAsyncHttpClient) asyncHttpClient(config)) {
assertDoesNotThrow(() -> client.prepareGet("https://www.google.com").execute().get());
assertInstanceOf(IOUringEventLoopGroup.class, client.channelManager().getEventLoopGroup());
assertInstanceOf(MultiThreadIoEventLoopGroup.class, client.channelManager().getEventLoopGroup());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.netty.handler.codec.http.HttpHeaders;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;

import javax.net.ServerSocketFactory;
import java.io.BufferedReader;
Expand All @@ -39,6 +40,7 @@
/**
* @author Hubert Iwaniuk
*/
@Disabled("New Netty Release Prevent Invalid Line in HTTP Header")
public class MultipleHeaderTest extends AbstractBasicTest {
private static ExecutorService executorService;
private static ServerSocket serverSocket;
Expand Down
4 changes: 2 additions & 2 deletions client/src/test/java/org/asynchttpclient/netty/NettyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import io.netty.channel.epoll.Epoll;
import io.netty.channel.kqueue.KQueue;
import io.netty.channel.uring.IoUring;
import io.netty.handler.codec.compression.Brotli;
import io.netty.handler.codec.compression.Zstd;
import io.netty.incubator.channel.uring.IOUring;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
Expand All @@ -21,7 +21,7 @@ public void epollIsAvailableOnLinux() {
@Test
@EnabledOnOs(OS.LINUX)
public void ioUringIsAvailableOnLinux() {
assertTrue(IOUring.isAvailable());
assertTrue(IoUring.isAvailable());
}

@Test
Expand Down
1 change: 1 addition & 0 deletions client/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<logger name="org.eclipse" level="INFO"/>
<logger name="org.apache" level="INFO"/>
<logger name="com.github.dockerjava" level="INFO"/>

<root level="DEBUG">
<appender-ref ref="CONSOLE"/>
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<netty.version>4.1.119.Final</netty.version>
<netty.version>4.2.5.Final</netty.version>
<netty.iouring>0.0.26.Final</netty.iouring>
<brotli4j.version>1.18.0</brotli4j.version>
<slf4j.version>2.0.16</slf4j.version>
Expand Down Expand Up @@ -206,17 +206,17 @@
</dependency>

<dependency>
<groupId>io.netty.incubator</groupId>
<artifactId>netty-incubator-transport-native-io_uring</artifactId>
<version>${netty.iouring}</version>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-io_uring</artifactId>
<version>${netty.version}</version>
<classifier>linux-x86_64</classifier>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.netty.incubator</groupId>
<artifactId>netty-incubator-transport-native-io_uring</artifactId>
<version>${netty.iouring}</version>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-io_uring</artifactId>
<version>${netty.version}</version>
<classifier>linux-aarch_64</classifier>
<optional>true</optional>
</dependency>
Expand Down
Loading