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

Houston Putman commented on KAFKA-19045:
----------------------------------------

I'm testing with a preview version of Java 25 and it looks like it is still 
there for now, so that's a good sign.

> ByteBufferUnmapper should not use the deprecated 
> sun.misc.Unsafe#invokeCleaner()
> --------------------------------------------------------------------------------
>
>                 Key: KAFKA-19045
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19045
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>            Reporter: Houston Putman
>            Priority: Major
>
> When using Java 24+ and utilizing Kafka Clients in the Solr cross-dc testing, 
> we see the following warnings from Java:
> {quote}{{WARNING: A terminally deprecated method in sun.misc.Unsafe has been 
> called}}
> {{WARNING: sun.misc.Unsafe::invokeCleaner has been called by 
> org.apache.kafka.common.utils.ByteBufferUnmapper}}
> {{WARNING: Please consider reporting this to the maintainers of class 
> org.apache.kafka.common.utils.ByteBufferUnmapper}}
> {{WARNING: sun.misc.Unsafe::invokeCleaner will be removed in a future 
> release}}
> {{{}OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot 
> loader classes because bootstrap classpath has been appended{}}}{{{{}}{}}}
> {quote}
> The [Lucene 
> {{MMapDirectory}}|https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java]
>  , that Kafka's ByteBufferUnmapper was based off of, has changed quite a lot 
> over the last few years, and no longer uses the 
> "sun.misc.Unsafe#invokeCleaner()" API. 
> The usage was removed in: [https://github.com/apache/lucene/pull/912]
> This was a major task, and Lucene now uses Java APIs that are only available 
> in preview modules. Therefore it also does a lot of work to build multiple 
> jars, each for a different version of the JDK (since the preview code might 
> change between versions). So this would probably be a big task for Kafka to 
> change it before those new Java APIs are no-longer preview-only. But anyways, 
> the method is deprecated, so it's good to get the discussion going early.



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

Reply via email to