[
https://issues.apache.org/jira/browse/KAFKA-19045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17938275#comment-17938275
]
Ismael Juma commented on KAFKA-19045:
-------------------------------------
Thanks for filing the ticket. Moving to the Foreign Function & Memory APIs is
indeed a large task. We would only use it for Java 25 (the first LTS with GA
version). That's a bit simpler than what Lucene has had to do, but still a
significant task. I guess the key question is whether `Unsafe.invokeCleaner`
will be removed in Java 25. If not, then we'd probably tackle this some time
after Java 25 is released.
> 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)