GeezerVison is showing github.com — Cassandra client fails with Netty 4.2.2 · Issue #15324 · netty/netty
Cassandra client fails with Netty 4.2.2 #15324
Description
Worked in 4.2.1, stopped working in 4.2.2 with the exception:
Caused by: java.lang.UnsupportedOperationException: ByteBuffer derived from closeable shared sessions not supported
at java.base/java.nio.DirectByteBuffer.address(DirectByteBuffer.java:319)
at java.base/java.util.zip.CRC32.update(CRC32.java:102)
at com.datastax.oss.driver.internal.core.protocol.ByteBufPrimitiveCodec.updateCrc(ByteBufPrimitiveCodec.java:153)
at com.datastax.oss.driver.internal.core.protocol.ByteBufPrimitiveCodec.updateCrc(ByteBufPrimitiveCodec.java:30)
at com.datastax.oss.protocol.internal.util.Crc.computeCrc32(Crc.java:31)
at com.datastax.oss.protocol.internal.SegmentCodec.encode(SegmentCodec.java:70)
at com.datastax.oss.driver.internal.core.protocol.SegmentToBytesEncoder.encode(SegmentToBytesEncoder.java:43)
at com.datastax.oss.driver.internal.core.protocol.SegmentToBytesEncoder.encode(SegmentToBytesEncoder.java:28)
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90)
This happens on JDK 24
Activity
wendigo commented on Jun 6, 2025
As far as I know until JDK 25, ByteBuffers created from shared MemorySegments won't work in certain internal Java APIs. This is going to be fixed by: openjdk/jdk#25324 and openjdk/jdk#25321
wendigo commented on Jun 6, 2025
wendigo commented on Jun 6, 2025
This is related to #15231 I think
chrisvest commented on Jun 6, 2025
@wendigo Yeah, you can see in #15231 how we had to add work-arounds for those JDK bugs to several places. Others will have to do the same as we can only fix Netty code. 😞 The only alternative is to just not use memory segments for obtaining native memory, but the performance hit of relying on the GC for freeing native memory is too much to tolerate.
wendigo commented on Jun 7, 2025
@chrisvest issue I'm facing is that the netty update alone switches to memorysegments and breaks cassandra client and there is no way of disabling these new memorysegment-based bytebuffers on JDK 24
slandelle commented on Jun 9, 2025
It looks to me like an unexpected breaking change from netty that should be reverted and only brought back for Java 25 when memory segments are more production ready.
Reacted by Mateusz "Serafin" Gajewski
normanmaurer commented on Jun 9, 2025
I agree with @slandelle... @chrisvest let's only enable memory segments once there is a Java25 release that actually fix it for real.
Reacted by Mateusz "Serafin" Gajewski and Chris Vest
chrisvest commented on Jun 10, 2025
Metadata
Metadata
Development
No branches or pull requestsIssue actions