[ 
https://issues.apache.org/jira/browse/CASSANDRA-17992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17624956#comment-17624956
 ] 

Benedict Elliott Smith commented on CASSANDRA-17992:
----------------------------------------------------

{{java.lang.ClassCastException: class 
org.apache.cassandra.utils.memory.BufferPool$Chunk cannot be cast to class 
sun.nio.ch.DirectBuffer}}

Uh oh. I guess I must have seen this before myself but not looked closely. This 
looks more pernicious to me, since it’s a {{BufferPool$Chunk}}. Either the JDK 
or Netty are probably unhappy at our use of the attachment field in 
{{DirectByteBuffer}}. Looking briefly at the JDK, it is unlikely to be to blame 
as there is a JNI constructor for {{DirectByteBuffer}} that accepts a plain 
object to hold onto, I guess to ensure that whatever native memory pointer the 
buffer references is not collected (and freed by a finalizer/reference queue). 
So we're not doing anything unacceptable.

This could be more annoying to resolve. We may need to upstream changes to 
Netty, or make quite invasive changes to our {{BufferPool}}.

Getting the full stack trace will help inform next steps.

> Upgrade Netty on 4.x(current trunk)
> -----------------------------------
>
>                 Key: CASSANDRA-17992
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17992
>             Project: Cassandra
>          Issue Type: Task
>          Components: Dependencies
>            Reporter: Ekaterina Dimitrova
>            Priority: Low
>             Fix For: 4.x
>
>
> I haven't been able to identify from the Netty docs which was the lowest 
> version where JDK17 was added but we are about 40 versions behind in netty 4 
> so I suspect we better update. 
> We need to consider there was an issue with class cast exceptions when 
> building with JDK17 with newer versions of netty (the newest available in 
> March 2022). For the record, we didn't see those when running CI on JDK8 and 
> JDK11. We also need to carefully revise the changes between the netty 
> versions.
> Upgrading will cover also a fix in netty that was discussed in 
> [this|https://the-asf.slack.com/archives/CK23JSY2K/p1665567660202989] ASF 
> Slack thread. 
> CC [~benedict] , [~aleksey] 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to