[
https://issues.apache.org/jira/browse/FLINK-15773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17024614#comment-17024614
]
Jozef Vilcek commented on FLINK-15773:
--------------------------------------
[~aljoscha] thanks for the hint. Joda's DateTimeZone defines `writeReplace`.
PrecalculatedZone inherits from DateTimeZone and therefore this call, in
usesCustomSerialization(), will not spot the method:
{code:java}
cls.getDeclaredMethod("writeReplace");{code}
but this one does:
{code:java}
cls.getSuperclass().getDeclaredMethod("writeReplace");{code}
I assume `usesCustomSerialization` should be searching for serialization
methods in whole class hierarchy?
> ClosureCleaner fails with joda DateTimeZone
> -------------------------------------------
>
> Key: FLINK-15773
> URL: https://issues.apache.org/jira/browse/FLINK-15773
> Project: Flink
> Issue Type: Bug
> Components: API / Core
> Affects Versions: 1.9.1
> Reporter: Jozef Vilcek
> Priority: Minor
>
> Flink fails to launch my Apache Beam job which uses windowing function with
> time zone. Closure cleaner reports time zone as not serializable. Part of
> stack trace:
>
> {noformat}
> org.joda.time.tz.DateTimeZoneBuilder$OfYear@3b035d0c is not serializable. The
> object probably contains or references non serializable fields.
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:151)
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
>
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
> org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:71)
> org.apache.flink.api.java.DataSet.clean(DataSet.java:186)
> org.apache.flink.api.java.DataSet.flatMap(DataSet.java:267)
> ....{noformat}
> Actual instance of DateTimeZone is
> [PrecalculatedZone|https://github.com/JodaOrg/joda-time/blob/v2.10.5/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L1373]
> which itself is serializable but it's fields are not necessarily standalone
> java serializable, because enclosing class it managing their serialization
> and deserialization.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)