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

ExceptionInInitializerError when initializing VertxByteBufAllocator #5404

Open
kolstae opened this issue Nov 22, 2024 · 0 comments
Open

ExceptionInInitializerError when initializing VertxByteBufAllocator #5404

kolstae opened this issue Nov 22, 2024 · 0 comments
Labels

Comments

@kolstae
Copy link

kolstae commented Nov 22, 2024

Version

5.0.0.CR1

Context

In an app started in kubernetes with 0.1 vCPU and 1 Gib memory, I get an ExceptionInInitializerError that I don't get on my local machine.

Exception in thread "main" java.lang.ExceptionInInitializerError
	at io.netty.buffer.ByteBufAllocator.<clinit>(ByteBufAllocator.java:24)
	at io.vertx.core.impl.buffer.VertxByteBufAllocator.<clinit>(VertxByteBufAllocator.java:26)
	at io.vertx.core.buffer.impl.BufferImpl.<init>(BufferImpl.java:54)
	at io.vertx.core.internal.buffer.BufferInternal.buffer(BufferInternal.java:63)
	at io.vertx.core.buffer.Buffer.buffer(Buffer.java:103)
	at io.vertx.core.file.impl.FileSystemImpl$16.perform(FileSystemImpl.java:879)
	at io.vertx.core.file.impl.FileSystemImpl$16.perform(FileSystemImpl.java:874)
	at io.vertx.core.file.impl.FileSystemImpl.readFileBlocking(FileSystemImpl.java:296)
	at no.finntech.recommendation.api.RoutingKt.loadRouting(routing.kt:22)
	at no.finntech.recommendation.api.App.<init>(ApiApp.kt:179)
	at no.finntech.recommendation.api.RecVerticle.start(ApiApp.kt:67)
	at io.vertx.kotlin.coroutines.CoroutineVerticle$start$1.invokeSuspend(CoroutineVerticle.kt:81)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:359)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:358)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:124)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:52)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:43)
	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
	at io.vertx.kotlin.coroutines.CoroutineVerticle.start(CoroutineVerticle.kt:79)
	at io.vertx.kotlin.coroutines.CoroutineVerticle.deploy(CoroutineVerticle.kt:54)
	at io.vertx.core.impl.deployment.Deployment.lambda$deploy$1(Deployment.java:162)
	at io.vertx.core.internal.ContextInternal.dispatch(ContextInternal.java:244)
	at io.vertx.core.internal.ContextInternal.dispatch(ContextInternal.java:226)
	at io.vertx.core.internal.ContextInternal.lambda$runOnContext$0(ContextInternal.java:50)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:148)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:141)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:521)
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:160)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1123)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: java.lang.IllegalArgumentException: capacity: 1 (expected: >= 2)
	at io.netty.util.internal.shaded.org.jctools.util.RangeUtil.checkGreaterThanOrEqual(RangeUtil.java:63)
	at io.netty.util.internal.shaded.org.jctools.queues.MpmcArrayQueue.<init>(MpmcArrayQueue.java:175)
	at io.netty.util.internal.PlatformDependent.newFixedMpmcQueue(PlatformDependent.java:1064)
	at io.netty.buffer.AdaptivePoolingAllocator.createSharedChunkQueue(AdaptivePoolingAllocator.java:191)
	at io.netty.buffer.AdaptivePoolingAllocator.<init>(AdaptivePoolingAllocator.java:127)
	at io.netty.buffer.AdaptiveByteBufAllocator.<init>(AdaptiveByteBufAllocator.java:59)
	at io.netty.buffer.AdaptiveByteBufAllocator.<init>(AdaptiveByteBufAllocator.java:52)
	at io.netty.buffer.AdaptiveByteBufAllocator.<init>(AdaptiveByteBufAllocator.java:48)
	at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:91)

Do you have a reproducer?

Not yet. I'm trying to reproduce locally with docker

Steps to reproduce

Native transport is preferred using netty-transport-native-io_uring

The code to trigger this is simply:

val vertx = Vertx.vertx(vertxOptionsOf(preferNativeTransport = true))
vertx.fileSystem().readFileBlocking(path.toString())

Extra

Tested with java 23 on linux

@kolstae kolstae added the bug label Nov 22, 2024
@kolstae kolstae changed the title vertx.fileSystem().readFileBlocking(path.toString()) ExceptionInInitializerError when initializing VertxByteBufAllocator Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant