[SUPPORT] the globalError in writeEvent Serialization failure
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 2.5k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 111
Description
**_Tips before filing an issue_**
- Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)?
- Join the mailing list to engage in conversations and get faster support at dev-subscribe@hudi.apache.org.
- If you have triaged this as a bug, then file an [issue](https://issues.apache.org/jira/projects/HUDI/issues) directly.
**Describe the problem you faced**
A clear and concise description of the problem.
**To Reproduce**
Steps to reproduce the behavior:
1.
2.
3.
4.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment Description**
* Hudi version : 0.10.0
* Spark version : -
* Hive version : -
* Hadoop version : -
* Storage (HDFS/S3/GCS..) : hdfs
* Running on Docker? (yes/no) : no
**Additional context**
In a Flink real-time production pipeline, if record-level exceptions occur, the configured globalError object might be non-serializable, causing WriteEvent transmission failures.
Solution: Define an intermediate exception format to encapsulate underlying errors, ensuring serializability.
**Stacktrace**
Throw exception :
`org.apache.flink.util.FlinkRuntimeException: Cannot serialize operator event
at org.apache.flink.streaming.runtime.tasks.OperatorEventDispatcherImpl$OperatorEventGatewayImpl.sendEventToCoordinator
Caused by: java.io.NotSerializableException: java.util.Optional
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185) ~[?:?]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553) ~[?:?]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) ~[?:?]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) ~[?:?]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) ~[?:?]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553) ~[?:?]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) ~[?:?]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) ~[?:?]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) ~[?:?]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349) ~[?:?]
at java.util.ArrayList.writeObject(ArrayList.java:897) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor120.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1145) ~[?:?]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1497) ~[?:?]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) ~[?:?]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) ~[?:?]
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1553) ~[?:?]
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1510) ~[?:?]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1433) ~[?:?]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179) ~[?:?]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349) ~[?:?]
at org.apache.flink.util.InstantiationUtil.serializeObject(InstantiationUtil.java:553) ~[]
at org.apache.flink.util.SerializedValue.(SerializedValue.java:62) ~[]
at org.apache.flink.streaming.runtime.tasks.OperatorEventDispatcherImpl$OperatorEventGatewayImpl.sendEventToCoordinator(OperatorEventDispatcherImpl.java:125) ~[]
... 6 more`
The globalError that needs to be serialized:
` Global error thrown while trying to write records in HoodieRowCreateHandle
org.apache.arrow.memory.OutOfMemoryException: Failure while allocating memory
at org.apache.arrow.vector.complex.ListVector.allocateNew(ListVector.java:250) ~`
The object causing serialization failure:
`public class OutOfMemoryException extends RuntimeException {
static final Logger logger = LoggerFactory.getLogger(OutOfMemoryException.class);
private static final long serialVersionUID = -6858052345185793382L;
private Optional outcomeDetails = Optional.empty();`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the globalError from HoodieRowCreateHandle through the Flink operator event path and inspect OutOfMemoryException, especially its Optional outcomeDetails field. The work is done when record-level errors can be carried in a serializable intermediate format and WriteEvent transmission no longer fails for non-serializable underlying exceptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- stream-processing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100