You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Galen Warren (Jira)" <ji...@apache.org> on 2021/12/06 14:52:00 UTC

[jira] [Created] (FLINK-25197) Using Statefun RequestReplyFunctionBuilder fails with Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling

Galen Warren created FLINK-25197:
------------------------------------

             Summary: Using Statefun RequestReplyFunctionBuilder fails with Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling 
                 Key: FLINK-25197
                 URL: https://issues.apache.org/jira/browse/FLINK-25197
             Project: Flink
          Issue Type: Bug
          Components: Stateful Functions
    Affects Versions: statefun-3.1.0
            Reporter: Galen Warren
             Fix For: statefun-3.1.0


When using RequestReplyFunctionBuilder to build a stateful functions job, the job fails at runtime with:

Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling 

It appears this is because, in [RequestReplyFunctionBuilder::transportClientPropertiesAsObjectNode|https://github.com/apache/flink-statefun/blob/b4ba9547b8f0105a28544fd28a5e0433666e9023/statefun-flink/statefun-flink-datastream/src/main/java/org/apache/flink/statefun/flink/datastream/RequestReplyFunctionBuilder.java#L127], a default instance of ObjectMapper is used to serialize the client properties, which now include a java.time.Duration. There is a [StateFunObjectMapper|https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-common/src/main/java/org/apache/flink/statefun/flink/common/json/StateFunObjectMapper.java] class in the project that has customized serde support, but it is not used here.

The fix seems to be to:
 * Use an instance of StateFunObjectMapper to serialize the client properties in RequestReplyFunctionBuilder
 * Modify StateFunObjecdtMapper to both serialize and deserialize instances of java.time.Duration (currently, only deserialization is supported)

I've made these changes locally and it seems to fix the problem. Would you be interested in a PR? Thanks.

 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Re: [jira] [Created] (FLINK-25197) Using Statefun RequestReplyFunctionBuilder fails with Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling

Posted by Galen Warren <ga...@cvillewarrens.com>.
Thanks for getting back to me and Happy Holidays! I'll open a PR soon, it's
a simple fix.

On Mon, Dec 20, 2021 at 9:42 AM Seth Wiesman <sj...@gmail.com> wrote:

> Hi Galen,
>
> Sorry for the late reply, a lot of people are on sporadic schedules with
> the holidays. A PR would be very welcome! I've gone ahead and assigned you
> the Jira. And I'll watch the repo to review your pr.
>
> cheers,
>
> Seth
>
> On Mon, Dec 20, 2021 at 8:24 AM Galen Warren <ga...@cvillewarrens.com>
> wrote:
>
> > I just wanted to check in on this, is there any interest in a PR to fix
> > this issue? Looking at the master branch, it still looks to be a problem.
> > Thanks.
> >
> > On Mon, Dec 6, 2021 at 9:52 AM Galen Warren (Jira) <ji...@apache.org>
> > wrote:
> >
> > > Galen Warren created FLINK-25197:
> > > ------------------------------------
> > >
> > >              Summary: Using Statefun RequestReplyFunctionBuilder fails
> > > with Java 8 date/time type `java.time.Duration` not supported by
> default:
> > > add Module
> > >
> >
> "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
> > > to enable handling
> > >                  Key: FLINK-25197
> > >                  URL:
> https://issues.apache.org/jira/browse/FLINK-25197
> > >              Project: Flink
> > >           Issue Type: Bug
> > >           Components: Stateful Functions
> > >     Affects Versions: statefun-3.1.0
> > >             Reporter: Galen Warren
> > >              Fix For: statefun-3.1.0
> > >
> > >
> > > When using RequestReplyFunctionBuilder to build a stateful functions
> job,
> > > the job fails at runtime with:
> > >
> > > Java 8 date/time type `java.time.Duration` not supported by default:
> add
> > > Module
> > >
> >
> "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
> > > to enable handling
> > >
> > > It appears this is because, in
> > > [RequestReplyFunctionBuilder::transportClientPropertiesAsObjectNode|
> > >
> >
> https://github.com/apache/flink-statefun/blob/b4ba9547b8f0105a28544fd28a5e0433666e9023/statefun-flink/statefun-flink-datastream/src/main/java/org/apache/flink/statefun/flink/datastream/RequestReplyFunctionBuilder.java#L127
> > ],
> > > a default instance of ObjectMapper is used to serialize the client
> > > properties, which now include a java.time.Duration. There is a
> > > [StateFunObjectMapper|
> > >
> >
> https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-common/src/main/java/org/apache/flink/statefun/flink/common/json/StateFunObjectMapper.java
> > ]
> > > class in the project that has customized serde support, but it is not
> > used
> > > here.
> > >
> > > The fix seems to be to:
> > >  * Use an instance of StateFunObjectMapper to serialize the client
> > > properties in RequestReplyFunctionBuilder
> > >  * Modify StateFunObjecdtMapper to both serialize and deserialize
> > > instances of java.time.Duration (currently, only deserialization is
> > > supported)
> > >
> > > I've made these changes locally and it seems to fix the problem. Would
> > you
> > > be interested in a PR? Thanks.
> > >
> > >
> > >
> > >
> > >
> > > --
> > > This message was sent by Atlassian Jira
> > > (v8.20.1#820001)
> > >
> >
>

Re: [jira] [Created] (FLINK-25197) Using Statefun RequestReplyFunctionBuilder fails with Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling

Posted by Seth Wiesman <sj...@gmail.com>.
Hi Galen,

Sorry for the late reply, a lot of people are on sporadic schedules with
the holidays. A PR would be very welcome! I've gone ahead and assigned you
the Jira. And I'll watch the repo to review your pr.

cheers,

Seth

On Mon, Dec 20, 2021 at 8:24 AM Galen Warren <ga...@cvillewarrens.com>
wrote:

> I just wanted to check in on this, is there any interest in a PR to fix
> this issue? Looking at the master branch, it still looks to be a problem.
> Thanks.
>
> On Mon, Dec 6, 2021 at 9:52 AM Galen Warren (Jira) <ji...@apache.org>
> wrote:
>
> > Galen Warren created FLINK-25197:
> > ------------------------------------
> >
> >              Summary: Using Statefun RequestReplyFunctionBuilder fails
> > with Java 8 date/time type `java.time.Duration` not supported by default:
> > add Module
> >
> "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
> > to enable handling
> >                  Key: FLINK-25197
> >                  URL: https://issues.apache.org/jira/browse/FLINK-25197
> >              Project: Flink
> >           Issue Type: Bug
> >           Components: Stateful Functions
> >     Affects Versions: statefun-3.1.0
> >             Reporter: Galen Warren
> >              Fix For: statefun-3.1.0
> >
> >
> > When using RequestReplyFunctionBuilder to build a stateful functions job,
> > the job fails at runtime with:
> >
> > Java 8 date/time type `java.time.Duration` not supported by default: add
> > Module
> >
> "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
> > to enable handling
> >
> > It appears this is because, in
> > [RequestReplyFunctionBuilder::transportClientPropertiesAsObjectNode|
> >
> https://github.com/apache/flink-statefun/blob/b4ba9547b8f0105a28544fd28a5e0433666e9023/statefun-flink/statefun-flink-datastream/src/main/java/org/apache/flink/statefun/flink/datastream/RequestReplyFunctionBuilder.java#L127
> ],
> > a default instance of ObjectMapper is used to serialize the client
> > properties, which now include a java.time.Duration. There is a
> > [StateFunObjectMapper|
> >
> https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-common/src/main/java/org/apache/flink/statefun/flink/common/json/StateFunObjectMapper.java
> ]
> > class in the project that has customized serde support, but it is not
> used
> > here.
> >
> > The fix seems to be to:
> >  * Use an instance of StateFunObjectMapper to serialize the client
> > properties in RequestReplyFunctionBuilder
> >  * Modify StateFunObjecdtMapper to both serialize and deserialize
> > instances of java.time.Duration (currently, only deserialization is
> > supported)
> >
> > I've made these changes locally and it seems to fix the problem. Would
> you
> > be interested in a PR? Thanks.
> >
> >
> >
> >
> >
> > --
> > This message was sent by Atlassian Jira
> > (v8.20.1#820001)
> >
>

Re: [jira] [Created] (FLINK-25197) Using Statefun RequestReplyFunctionBuilder fails with Java 8 date/time type `java.time.Duration` not supported by default: add Module "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling

Posted by Galen Warren <ga...@cvillewarrens.com>.
I just wanted to check in on this, is there any interest in a PR to fix
this issue? Looking at the master branch, it still looks to be a problem.
Thanks.

On Mon, Dec 6, 2021 at 9:52 AM Galen Warren (Jira) <ji...@apache.org> wrote:

> Galen Warren created FLINK-25197:
> ------------------------------------
>
>              Summary: Using Statefun RequestReplyFunctionBuilder fails
> with Java 8 date/time type `java.time.Duration` not supported by default:
> add Module
> "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
> to enable handling
>                  Key: FLINK-25197
>                  URL: https://issues.apache.org/jira/browse/FLINK-25197
>              Project: Flink
>           Issue Type: Bug
>           Components: Stateful Functions
>     Affects Versions: statefun-3.1.0
>             Reporter: Galen Warren
>              Fix For: statefun-3.1.0
>
>
> When using RequestReplyFunctionBuilder to build a stateful functions job,
> the job fails at runtime with:
>
> Java 8 date/time type `java.time.Duration` not supported by default: add
> Module
> "org.apache.flink.shaded.jackson2.com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
> to enable handling
>
> It appears this is because, in
> [RequestReplyFunctionBuilder::transportClientPropertiesAsObjectNode|
> https://github.com/apache/flink-statefun/blob/b4ba9547b8f0105a28544fd28a5e0433666e9023/statefun-flink/statefun-flink-datastream/src/main/java/org/apache/flink/statefun/flink/datastream/RequestReplyFunctionBuilder.java#L127],
> a default instance of ObjectMapper is used to serialize the client
> properties, which now include a java.time.Duration. There is a
> [StateFunObjectMapper|
> https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-common/src/main/java/org/apache/flink/statefun/flink/common/json/StateFunObjectMapper.java]
> class in the project that has customized serde support, but it is not used
> here.
>
> The fix seems to be to:
>  * Use an instance of StateFunObjectMapper to serialize the client
> properties in RequestReplyFunctionBuilder
>  * Modify StateFunObjecdtMapper to both serialize and deserialize
> instances of java.time.Duration (currently, only deserialization is
> supported)
>
> I've made these changes locally and it seems to fix the problem. Would you
> be interested in a PR? Thanks.
>
>
>
>
>
> --
> This message was sent by Atlassian Jira
> (v8.20.1#820001)
>