apache / apache/beam

Tensor flow Chicago taxi failing for 117MB data with IndexOutOfBoundException on Flink MemorySegment

Open
#19,141 0 comments 0 reactions 0 assignees View on GitHub
bug flink fn-execution java P3 runners
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

Relevant Stack trace: 

 
```

[flink-runner-job-server] ERROR org.apache.beam.runners.flink.FlinkJobInvocation - Error during job
invocation BeamApp-goenka-1114034940-664c45b0_33f1a6cc-adad-47ec-8742-0fbb2617d705. org.apache.flink.client.program.ProgramInvocationException:
Job f80127168dd5f8eea7c071539e642cc8 failed. at org.apache.flink.client.program.rest.RestClusterClient.submitJob(RestClusterClient.java:265)
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:464) at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:452)
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:427) at org.apache.flink.client.RemoteExecutor.executePlanWithJars(RemoteExecutor.java:216)
at org.apache.flink.client.RemoteExecutor.executePlan(RemoteExecutor.java:193) at org.apache.flink.api.java.RemoteEnvironment.execute(RemoteEnvironment.java:173)
at org.apache.beam.runners.flink.FlinkJobInvocation.runPipeline(FlinkJobInvocation.java:117) at org.apache.beam.repackaged.beam_runners_flink_2.11.com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)
at org.apache.beam.repackaged.beam_runners_flink_2.11.com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)
at org.apache.beam.repackaged.beam_runners_flink_2.11.com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.flink.runtime.client.JobExecutionException:
Job execution failed. at org.apache.flink.runtime.jobmaster.JobResult.toJobExecutionResult(JobResult.java:146)
at org.apache.flink.client.program.rest.RestClusterClient.submitJob(RestClusterClient.java:262) ...
13 more Caused by: java.lang.Exception: The data preparation for task 'GroupReduce (GroupReduce at GenerateStatistics/RunStatsGenerators/CommonStatsGenerator/CombinePerKey/GroupByKey)'
, caused an error: Error obtaining the sorted input: Thread 'SortMerger Reading Thread' terminated due
to an exception: null at org.apache.flink.runtime.operators.BatchTask.run(BatchTask.java:479) at org.apache.flink.runtime.operators.BatchTask.invoke(BatchTask.java:368)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:712) ... 1 more Caused by: java.lang.RuntimeException:
Error obtaining the sorted input: Thread 'SortMerger Reading Thread' terminated due to an exception:
null at org.apache.flink.runtime.operators.sort.UnilateralSortMerger.getIterator(UnilateralSortMerger.java:650)
at org.apache.flink.runtime.operators.BatchTask.getInput(BatchTask.java:1108) at org.apache.flink.runtime.operators.GroupReduceDriver.prepare(GroupReduceDriver.java:99)
at org.apache.flink.runtime.operators.BatchTask.run(BatchTask.java:473) ... 3 more Caused by: java.io.IOException:
Thread 'SortMerger Reading Thread' terminated due to an exception: null at org.apache.flink.runtime.operators.sort.UnilateralSortMerger$ThreadBase.run(UnilateralSortMerger.java:831)
Caused by: java.lang.IndexOutOfBoundsException at org.apache.flink.core.memory.HybridMemorySegment.put(HybridMemorySegment.java:232)
at org.apache.flink.runtime.memory.AbstractPagedOutputView.write(AbstractPagedOutputView.java:192) at
org.apache.beam.runners.flink.translation.wrappers.DataOutputViewWrapper.write(DataOutputViewWrapper.java:48)
at java.io.DataOutputStream.write(DataOutputStream.java:107) at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:167)
at org.apache.beam.sdk.coders.LengthPrefixCoder.encode(LengthPrefixCoder.java:58) at org.apache.beam.sdk.coders.IterableLikeCoder.encode(IterableLikeCoder.java:98)
at org.apache.beam.sdk.coders.IterableLikeCoder.encode(IterableLikeCoder.java:60) at org.apache.beam.sdk.coders.Coder.encode(Coder.java:136)
at org.apache.beam.sdk.coders.KvCoder.encode(KvCoder.java:71) at org.apache.beam.sdk.coders.KvCoder.encode(KvCoder.java:36)
at org.apache.beam.sdk.util.WindowedValue$FullWindowedValueCoder.encode(WindowedValue.java:529) at org.apache.beam.sdk.util.WindowedValue$FullWindowedValueCoder.encode(WindowedValue.java:520)
at org.apache.beam.sdk.util.WindowedValue$FullWindowedValueCoder.encode(WindowedValue.java:480) at org.apache.beam.runners.flink.translation.types.CoderTypeSerializer.serialize(CoderTypeSerializer.java:83)
at org.apache.flink.api.java.typeutils.runtime.TupleSerializer.serialize(TupleSerializer.java:125) at
org.apache.flink.api.java.typeutils.runtime.TupleSerializer.serialize(TupleSerializer.java:30) at org.apache.flink.runtime.operators.sort.LargeRecordHandler.addRecord(LargeRecordHandler.java:214)
at org.apache.flink.runtime.operators.sort.UnilateralSortMerger$ReadingThread.go(UnilateralSortMerger.java:982)
at org.apache.flink.runtime.operators.sort.UnilateralSortMerger$ThreadBase.run(UnilateralSortMerger.java:827)
[grpc-default-executor-21] INFO org.apache.beam.runners.flink.FlinkJobInvoker - Invoking job BeamApp-goenka-1114035621-e0778462_36ecd5e4-ead8-4ef0-a689-4b82e7b0194a

```

 

Imported from Jira [BEAM-6060](https://issues.apache.org/jira/browse/BEAM-6060). Original Jira may contain additional context.
Reported by: angoenka.

Contributor guide

Open the contributing guide

Research direction

Start with the failing path in org.apache.flink.core.memory.HybridMemorySegment.put and AbstractPagedOutputView.write, then trace the serialization through DataOutputViewWrapper and CoderTypeSerializer. Investigate the 117MB Chicago taxi workload and verify that the Flink runner completes without the IndexOutOfBoundsException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.