umeshdangat opened a new pull request, #3400:
URL: https://github.com/apache/flink-cdc/pull/3400
There is a circular dependency between the `DataFieldSerializer`,
`DataTypeSerializer`, and `RowTypeSerializer` classes. This circular dependency
can lead to incomplete initialization of the serializers, causing a
`NullPointerException` when you attempt to use them.
Here's a breakdown of the problem:
1. `DataFieldSerializer` has a `DataTypeSerializer` instance.
2. `DataTypeSerializer` has a `RowTypeSerializer` instance.
3. `RowTypeSerializer` has a `ListSerializer<DataField>` instance, which in
turn uses `DataFieldSerializer`.
This circular dependency can cause the serializers to be in an incomplete
state when they are first accessed, leading to the `NullPointerException`.
Code below is enough to re-create this NPE
```
RowType innerMostRowType = RowType.of(DataTypes.BIGINT());
RowType outerRowType = RowType.of(
DataTypes.ROW(DataTypes.FIELD("outerRow",
innerMostRowType)));
DataTypeSerializer serializer = new DataTypeSerializer();
assertNotNull(RowTypeSerializer.INSTANCE,
"RowTypeSerializer.INSTANCE is null");
RowType copiedRow = (RowType) serializer.copy(outerRowType);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]