Ayush Saxena created TEZ-4609:
---------------------------------

             Summary: JDK-17: Fix ByteBuffer mark incompatibility in 
PipelinedSorter
                 Key: TEZ-4609
                 URL: https://issues.apache.org/jira/browse/TEZ-4609
             Project: Apache Tez
          Issue Type: Sub-task
            Reporter: Ayush Saxena
            Assignee: Ayush Saxena


While running with JDK-17
{noformat}
Iteration 0 failed with diagnostics: [Vertex failed, vertexName=Tokenizer, 
vertexId=vertex_1742803884062_0001_1_00, diagnostics=[Task failed, 
taskId=task_1742803884062_0001_1_00_000000, diagnostics=[TaskAttempt 0 failed, 
info=[Error: Node: ayushsaxena/127.0.0.1 : Encountered an Error while executing 
task: attempt_1742803884062_0001_1_00_000000_0:java.lang.NoSuchMethodError: 
java.nio.ByteBuffer.mark()Ljava/nio/ByteBuffer;
        at 
org.apache.tez.runtime.library.common.sort.impl.PipelinedSorter$SortSpan.<init>(PipelinedSorter.java:949)
        at 
org.apache.tez.runtime.library.common.sort.impl.PipelinedSorter.<init>(PipelinedSorter.java:230)
        at 
org.apache.tez.runtime.library.output.OrderedPartitionedKVOutput.start(OrderedPartitionedKVOutput.java:151)
        at 
org.apache.tez.runtime.library.processor.SimpleProcessor.preOp(SimpleProcessor.java:87)
        at 
org.apache.tez.runtime.library.processor.SimpleProcessor.run(SimpleProcessor.java:60)
        at 
org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:381)
        at 
org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:86)
        at 
org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:72)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1953)
        at 
org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:72)
        at 
org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:42)
        at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
{noformat}
 

*Reason:*
The ByteBuffer.mark() method returns ByteBuffer itself in Java 8, but starting 
with JDK 9+, it returns a more specific subclass (like HeapByteBuffer or 
DirectByteBuffer), which is incompatible with method signatures expecting 
ByteBuffer.

When running the same code in JDK 17, this mismatch triggers a 
_NoSuchMethodError_ due to binary incompatibility.



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

Reply via email to