Hi, we have a couple of ktor applications. Before ...
# ktor
m
Hi, we have a couple of ktor applications. Before we didn't get this WARNING message, but as we've bumped up ktor versions along the way we've started getting the following message:
Copy code
message: A task raised an exception. Task: io.netty.channel.AbstractChannel$AbstractUnsafe$8@7a8dccce

stacktrace: java.util.concurrent.RejectedExecutionException: event executor terminated at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:1005) at io.netty.util.concurrent.SingleThreadEventExecutor.offerTask(SingleThreadEventExecutor.java:388) at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:381) at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:907) at io.netty.util.concurrent.SingleThreadEventExecutor.execute0(SingleThreadEventExecutor.java:873) at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:863) at io.netty.channel.DefaultChannelPipeline.destroyUp(DefaultChannelPipeline.java:816) at io.netty.channel.DefaultChannelPipeline.destroy(DefaultChannelPipeline.java:801) at io.netty.channel.DefaultChannelPipeline.access$700(DefaultChannelPipeline.java:45) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelUnregistered(DefaultChannelPipeline.java:1411) at io.netty.channel.DefaultChannelPipeline.fireChannelUnregistered(DefaultChannelPipeline.java:780) at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:692) 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:507) at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:182) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073) 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:1583)
What could be causing this? I'm trying to understand why we didn't get this before but started getting it with the latest version of ktor 3.2.3 We have alarms for our applications and often get this WARNING alarm which is quite annoying. Anything I can do to resolve this?
a
Does
RejectedExecutionException
occur on the server shutdown? The exception looks similar to the one described in KTOR-8671.
m
On KTOR-8671 it is mentioned that it happens on macOS when dev mode is on. But we use bellsoft/liberica-openjdk-alpine:21.0.8 image and deploy it to Google Cloud. Happens with us in both development and production.
amd64 image, not arm image
And as Shirish said in the thread, we dont have that issue with 3.1* versions of Ktor
a
Can you please share a sample project to reproduce the exception?