Jeff Hudson
11/08/2024, 3:51 PMRequest failed. java.lang.IllegalStateException: Check failed.
at kotlinx.io.Segment.compact$kotlinx_io_core(Segment.kt:234) ~[server.jar:?]
at kotlinx.io.Buffer.write(Buffer.kt:739) ~[server.jar:?]
at kotlinx.io.Buffer.transferTo(Buffer.kt:335) ~[server.jar:?]
at io.ktor.utils.io.ByteChannel.moveFlushToReadBuffer(ByteChannel.kt:79) ~[server.jar:?]
at io.ktor.utils.io.ByteChannel.awaitContent(ByteChannel.kt:72) ~[server.jar:?]
at io.ktor.utils.io.ByteChannel$awaitContent$1.invokeSuspend(ByteChannel.kt) ~[server.jar:?]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [server.jar:?]
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101) [server.jar:?]
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113) [server.jar:?]
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89) [server.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589) [server.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823) [server.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720) [server.jar:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707) [server.jar:?]
Wondering if anyone has any ideas…
It does not seem deterministic — this will happen for a given request less than 0.1% of the time, and it will not happen on a subsequent identical request.Jeff Hudson
11/08/2024, 3:53 PMJeff Hudson
11/08/2024, 3:57 PMJeff Hudson
11/08/2024, 3:57 PMFilipp Zhinkin
11/08/2024, 5:05 PMFilipp Zhinkin
11/08/2024, 7:25 PMsuccessor
could only be null
(compact's receiver is popped itself, and pop
sets both prev
and next
to null
).
So it looks like an issue with concurrent buffer modification (at some other place in the application, not where the exception was thrown).Jeff Hudson
11/08/2024, 7:26 PMJeff Hudson
11/08/2024, 7:26 PMFilipp Zhinkin
11/08/2024, 7:39 PMDo you know what these buffers might be used for?Hard to say (for me), but the reproducer should help
Bruce Hamilton
11/09/2024, 8:22 AMBruce Hamilton
11/09/2024, 8:25 AMConcurrentIOException
somewhere.