diff --git a/all/pom.xml b/all/pom.xml index d0a186dc417..ac8ce89da3e 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-all diff --git a/bom/pom.xml b/bom/pom.xml index f74949ba8aa..f2efb4510fd 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -25,7 +25,7 @@ io.netty netty-bom - 4.1.128.1.dse + 4.1.128.2.dse pom Netty/BOM diff --git a/buffer/pom.xml b/buffer/pom.xml index 21dd16f77d9..56492e8dbc8 100644 --- a/buffer/pom.xml +++ b/buffer/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-buffer diff --git a/codec-dns/pom.xml b/codec-dns/pom.xml index 39846136332..8880ea27a66 100644 --- a/codec-dns/pom.xml +++ b/codec-dns/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-dns diff --git a/codec-haproxy/pom.xml b/codec-haproxy/pom.xml index b7a0e7202a1..1861196943d 100644 --- a/codec-haproxy/pom.xml +++ b/codec-haproxy/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-haproxy diff --git a/codec-http/pom.xml b/codec-http/pom.xml index 9d37046e74e..717637c9721 100644 --- a/codec-http/pom.xml +++ b/codec-http/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-http diff --git a/codec-http2/pom.xml b/codec-http2/pom.xml index f363a73fbdb..364f2c014a0 100644 --- a/codec-http2/pom.xml +++ b/codec-http2/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-http2 diff --git a/codec-memcache/pom.xml b/codec-memcache/pom.xml index f5b785a1331..5ebd5c5f456 100644 --- a/codec-memcache/pom.xml +++ b/codec-memcache/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-memcache diff --git a/codec-mqtt/pom.xml b/codec-mqtt/pom.xml index 1a6aaabe7a1..dedaf789c93 100644 --- a/codec-mqtt/pom.xml +++ b/codec-mqtt/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-mqtt diff --git a/codec-redis/pom.xml b/codec-redis/pom.xml index 38b73c9326b..2cbec9a1db9 100644 --- a/codec-redis/pom.xml +++ b/codec-redis/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-redis diff --git a/codec-smtp/pom.xml b/codec-smtp/pom.xml index b0896da7ebc..1defdbca5b8 100644 --- a/codec-smtp/pom.xml +++ b/codec-smtp/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-smtp diff --git a/codec-socks/pom.xml b/codec-socks/pom.xml index 2397bb2e3fa..a5572c28c5e 100644 --- a/codec-socks/pom.xml +++ b/codec-socks/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-socks diff --git a/codec-stomp/pom.xml b/codec-stomp/pom.xml index 285373a69b3..9dd9218785d 100644 --- a/codec-stomp/pom.xml +++ b/codec-stomp/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-stomp diff --git a/codec-xml/pom.xml b/codec-xml/pom.xml index 8b7b69babfb..1338762d79c 100644 --- a/codec-xml/pom.xml +++ b/codec-xml/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec-xml diff --git a/codec/pom.xml b/codec/pom.xml index d121be92666..c7cec386fee 100644 --- a/codec/pom.xml +++ b/codec/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-codec diff --git a/common/pom.xml b/common/pom.xml index 81587e4e9f0..315df06e77e 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -21,7 +21,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-common diff --git a/dev-tools/pom.xml b/dev-tools/pom.xml index f587cce722c..40b94308104 100644 --- a/dev-tools/pom.xml +++ b/dev-tools/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-dev-tools diff --git a/example/pom.xml b/example/pom.xml index 682c3cb3848..9d56807deee 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -21,7 +21,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-example diff --git a/handler-proxy/pom.xml b/handler-proxy/pom.xml index ebc56a14add..daaaf72e4ab 100644 --- a/handler-proxy/pom.xml +++ b/handler-proxy/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-handler-proxy diff --git a/handler-ssl-ocsp/pom.xml b/handler-ssl-ocsp/pom.xml index d7e0056466e..21db32899e9 100644 --- a/handler-ssl-ocsp/pom.xml +++ b/handler-ssl-ocsp/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-handler-ssl-ocsp diff --git a/handler/pom.xml b/handler/pom.xml index e0011af86f8..4158bf127b9 100644 --- a/handler/pom.xml +++ b/handler/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-handler diff --git a/microbench/pom.xml b/microbench/pom.xml index 8850eb00316..ea7262cb5cb 100644 --- a/microbench/pom.xml +++ b/microbench/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-microbench diff --git a/pom.xml b/pom.xml index d32129b8bd5..639231a26e8 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ io.netty netty-parent pom - 4.1.128.1.dse + 4.1.128.2.dse Netty https://netty.io/ diff --git a/resolver-dns-classes-macos/pom.xml b/resolver-dns-classes-macos/pom.xml index 230036b95b1..9c87c56910b 100644 --- a/resolver-dns-classes-macos/pom.xml +++ b/resolver-dns-classes-macos/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-resolver-dns-classes-macos diff --git a/resolver-dns-native-macos/pom.xml b/resolver-dns-native-macos/pom.xml index dfa467c1f1e..71c5863eaf7 100644 --- a/resolver-dns-native-macos/pom.xml +++ b/resolver-dns-native-macos/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-resolver-dns-native-macos diff --git a/resolver-dns/pom.xml b/resolver-dns/pom.xml index addbb1dae09..6a3684fdfe8 100644 --- a/resolver-dns/pom.xml +++ b/resolver-dns/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-resolver-dns diff --git a/resolver/pom.xml b/resolver/pom.xml index 4fca568e0f9..f155519b6eb 100644 --- a/resolver/pom.xml +++ b/resolver/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-resolver diff --git a/testsuite-autobahn/pom.xml b/testsuite-autobahn/pom.xml index af5acaf68b3..47606069242 100644 --- a/testsuite-autobahn/pom.xml +++ b/testsuite-autobahn/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-autobahn diff --git a/testsuite-http2/pom.xml b/testsuite-http2/pom.xml index cec0164e73e..91d429601c8 100644 --- a/testsuite-http2/pom.xml +++ b/testsuite-http2/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-http2 diff --git a/testsuite-native-image-client-runtime-init/pom.xml b/testsuite-native-image-client-runtime-init/pom.xml index 8fa230f0e6a..f23259b03e8 100644 --- a/testsuite-native-image-client-runtime-init/pom.xml +++ b/testsuite-native-image-client-runtime-init/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-native-image-client-runtime-init diff --git a/testsuite-native-image-client/pom.xml b/testsuite-native-image-client/pom.xml index 563d24b1d6f..d6583d287c8 100644 --- a/testsuite-native-image-client/pom.xml +++ b/testsuite-native-image-client/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-native-image-client diff --git a/testsuite-native-image/pom.xml b/testsuite-native-image/pom.xml index 2266f6eac51..04e926aea66 100644 --- a/testsuite-native-image/pom.xml +++ b/testsuite-native-image/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-native-image diff --git a/testsuite-native/pom.xml b/testsuite-native/pom.xml index 3b5d008617a..fccae16893d 100644 --- a/testsuite-native/pom.xml +++ b/testsuite-native/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-native diff --git a/testsuite-osgi/pom.xml b/testsuite-osgi/pom.xml index 0ce12fe0e03..557f575b3d3 100644 --- a/testsuite-osgi/pom.xml +++ b/testsuite-osgi/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-osgi diff --git a/testsuite-shading/pom.xml b/testsuite-shading/pom.xml index 43f0355a568..c7a436bf390 100644 --- a/testsuite-shading/pom.xml +++ b/testsuite-shading/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite-shading diff --git a/testsuite/pom.xml b/testsuite/pom.xml index 289cccfee8f..d5a063dae94 100644 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-testsuite diff --git a/transport-blockhound-tests/pom.xml b/transport-blockhound-tests/pom.xml index c109f9ba179..0b76c910faf 100644 --- a/transport-blockhound-tests/pom.xml +++ b/transport-blockhound-tests/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-blockhound-tests diff --git a/transport-classes-epoll/pom.xml b/transport-classes-epoll/pom.xml index 593265cc3ce..86a47ddd815 100644 --- a/transport-classes-epoll/pom.xml +++ b/transport-classes-epoll/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-classes-epoll diff --git a/transport-classes-kqueue/pom.xml b/transport-classes-kqueue/pom.xml index 4242dd74bc3..54946e0994b 100644 --- a/transport-classes-kqueue/pom.xml +++ b/transport-classes-kqueue/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-classes-kqueue diff --git a/transport-native-epoll/pom.xml b/transport-native-epoll/pom.xml index 7ac617deb2a..e6322456fb4 100644 --- a/transport-native-epoll/pom.xml +++ b/transport-native-epoll/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-native-epoll @@ -38,7 +38,7 @@ ${unix.common.lib.dir}/META-INF/native/lib ${unix.common.lib.dir}/META-INF/native/include CFLAGS=-O2 -pipe -Werror -fno-omit-frame-pointer -Wunused-variable -fvisibility=hidden -D_FORTIFY_SOURCE=2 -ffunction-sections -fdata-sections -I${unix.common.include.unpacked.dir} - LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,--gc-sections -L${unix.common.lib.unpacked.dir} -laio + LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,--gc-sections -L${unix.common.lib.unpacked.dir} LIBS=-Wl,--whole-archive -l${unix.common.lib.name} -Wl,--no-whole-archive -ldl -lrt ${project.basedir}/src/main/c true diff --git a/transport-native-epoll/src/main/c/netty_epoll_native.c b/transport-native-epoll/src/main/c/netty_epoll_native.c index eda94b3992b..86f89c3c013 100644 --- a/transport-native-epoll/src/main/c/netty_epoll_native.c +++ b/transport-native-epoll/src/main/c/netty_epoll_native.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -794,6 +795,53 @@ static jint netty_epoll_native_registerUnix(JNIEnv* env, jclass clazz) { //LibAIO methods +// Dynamic loading of libaio functions +static void* libaio_handle = NULL; +static int (*libaio_io_setup)(int maxevents, io_context_t *ctxp) = NULL; +static int (*libaio_io_submit)(io_context_t ctx, long nr, struct iocb *ios[]) = NULL; +static int (*libaio_io_getevents)(io_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct timespec *timeout) = NULL; +static int (*libaio_io_destroy)(io_context_t ctx) = NULL; + +static int load_libaio() { + int i; + if (libaio_handle != NULL) { + return 0; // Already loaded + } + + // Try different library names for compatibility + const char* lib_names[] = { + "libaio.so.1t64", // Newer Ubuntu/Debian with time64 + "libaio.so.1", // Older systems + "libaio.so", // Fallback + NULL + }; + + for (i = 0; lib_names[i] != NULL; i++) { + libaio_handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL); + if (libaio_handle != NULL) { + break; + } + } + + if (libaio_handle == NULL) { + return -1; + } + + // Load function pointers + libaio_io_setup = dlsym(libaio_handle, "io_setup"); + libaio_io_submit = dlsym(libaio_handle, "io_submit"); + libaio_io_getevents = dlsym(libaio_handle, "io_getevents"); + libaio_io_destroy = dlsym(libaio_handle, "io_destroy"); + + if (!libaio_io_setup || !libaio_io_submit || !libaio_io_getevents || !libaio_io_destroy) { + dlclose(libaio_handle); + libaio_handle = NULL; + return -1; + } + + return 0; +} + // the maximum number of buffers for a vectored IO request #define MAX_NUM_BUFFERS_PER_REQUEST 8 @@ -819,6 +867,12 @@ static jlong netty_epoll_native_createAIOContext0(JNIEnv* env, jclass clazz, jin return JNI_ERR; } + // Load libaio dynamically if not already loaded + if (load_libaio() != 0) { + netty_unix_errors_throwRuntimeException(env, "Failed to load libaio library. Tried: libaio.so.1t64, libaio.so.1, libaio.so"); + return JNI_ERR; + } + netty_io_context_t* ctx = malloc(sizeof(netty_io_context_t)); ctx->aio = 0; ctx->concurrency = concurrency; @@ -830,7 +884,7 @@ static jlong netty_epoll_native_createAIOContext0(JNIEnv* env, jclass clazz, jin } int r; - r = io_setup(concurrency, &(ctx->aio)); + r = libaio_io_setup(concurrency, &(ctx->aio)); if (r != 0) { netty_unix_errors_throwChannelExceptionErrorNo(env, "io_setup() failed: ", -r); } @@ -942,7 +996,7 @@ static void netty_epoll_native_submitAIORead0(JNIEnv* env, jclass clazz, jlong c } //printf("Submitting request\n"); - int r = io_submit(ctx->aio, num_requests, iocbps); + int r = libaio_io_submit(ctx->aio, num_requests, iocbps); if (r != num_requests) { //printf("io_submit() failed with %d\n", r); netty_unix_errors_throwChannelExceptionErrorNo(env, "io_submit() failed: ", -r); @@ -980,7 +1034,7 @@ static jint netty_epoll_native_getAIOEvents0(JNIEnv* env, jclass clazz, jlong ct timeout.tv_nsec = 0; int r, j, slot; - r = io_getevents(ctx->aio, 1, ctx->concurrency, events, &timeout); + r = libaio_io_getevents(ctx->aio, 1, ctx->concurrency, events, &timeout); //printf("io_getevents() returned %d\n", r); if (r > 0) { diff --git a/transport-native-kqueue/pom.xml b/transport-native-kqueue/pom.xml index f6fcc3b87d0..2903bddb37f 100644 --- a/transport-native-kqueue/pom.xml +++ b/transport-native-kqueue/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-native-kqueue diff --git a/transport-native-unix-common-tests/pom.xml b/transport-native-unix-common-tests/pom.xml index 4be08a13265..28419cc6f15 100644 --- a/transport-native-unix-common-tests/pom.xml +++ b/transport-native-unix-common-tests/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-native-unix-common-tests diff --git a/transport-native-unix-common/pom.xml b/transport-native-unix-common/pom.xml index dd6880e6f51..19aa0d636a1 100644 --- a/transport-native-unix-common/pom.xml +++ b/transport-native-unix-common/pom.xml @@ -19,7 +19,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-native-unix-common diff --git a/transport-rxtx/pom.xml b/transport-rxtx/pom.xml index df1cc7672c6..34153f38a9e 100644 --- a/transport-rxtx/pom.xml +++ b/transport-rxtx/pom.xml @@ -21,7 +21,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-rxtx diff --git a/transport-sctp/pom.xml b/transport-sctp/pom.xml index 5ce10d35157..54079f7264d 100644 --- a/transport-sctp/pom.xml +++ b/transport-sctp/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-sctp diff --git a/transport-udt/pom.xml b/transport-udt/pom.xml index f2dcfb7498e..a5cddc4c55c 100644 --- a/transport-udt/pom.xml +++ b/transport-udt/pom.xml @@ -21,7 +21,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport-udt diff --git a/transport/pom.xml b/transport/pom.xml index f9e2a81e2df..8fef38a5bc7 100644 --- a/transport/pom.xml +++ b/transport/pom.xml @@ -20,7 +20,7 @@ io.netty netty-parent - 4.1.128.1.dse + 4.1.128.2.dse netty-transport