[ 
https://issues.apache.org/jira/browse/FLINK-32978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17804459#comment-17804459
 ] 

Sergey Nuyanzin edited comment on FLINK-32978 at 1/8/24 8:47 PM:
-----------------------------------------------------------------

[~Wencong Liu], [~xtsong] this looks like a breaking change especially for 
classes where signature changed from {{public void open(Configuration 
parameters)}} to {{public void open(OpenContext openContext)}}

e.g.this change for 
{{org.apache.flink.streaming.api.functions.source.MultipleIdsMessageAcknowledgingSourceBase}}
was before the commit
{code:java}
    @Override
    public void open(Configuration parameters) throws Exception {
        super.open(parameters);
        sessionIds = new ArrayList<>(64);
        sessionIdsPerSnapshot = new ArrayDeque<>();
    }
{code}
and after
{code:java}
    @Override
    public void open(OpenContext openContext) throws Exception {
        super.open(openContext);
        sessionIds = new ArrayList<>(64);
        sessionIdsPerSnapshot = new ArrayDeque<>();
    }
{code}
also changes could be seen at 
[https://github.com/apache/flink/pull/23058/files#diff-59e8c6f938bd5fed55424ceb712a4617c3bfd8b45ab6a941af51521f7eae69c6L96-L98]

the problem with this change is that if someone extends from this class 
{{MultipleIdsMessageAcknowledgingSourceBase}} and calls 
{{super.open(<Configuration>)}} then now it will be redirected to 
{{org.apache.flink.api.common.functions.AbstractRichFunction#open}} and now 
variables stopped being initialized...

Exactly this happened with flink-connector-rabbitmq at 
[https://github.com/apache/flink-connector-rabbitmq/pull/22]

Since there are several places like that I think it should be explicitly 
mentioned what to do and how to check it during updates. The tricky thing is 
that the code still continues being compiled however some tests unexpectedly 
behave in unpredictable way...


was (Author: sergey nuyanzin):
[~Wencong Liu], [~xtsong] this looks like a breaking change especially for 
classes where signature changed from {{public void open(Configuration 
parameters)}} to {{public void open(OpenContext openContext)}}

e.g.this change for 
{{org.apache.flink.streaming.api.functions.source.MultipleIdsMessageAcknowledgingSourceBase}}
was before the commit

{code:java}
    @Override
    public void open(Configuration parameters) throws Exception {
        super.open(parameters);
        sessionIds = new ArrayList<>(64);
        sessionIdsPerSnapshot = new ArrayDeque<>();
    }
{code}

and after 
{code:java}
    @Override
    @Override
    public void open(OpenContext openContext) throws Exception {
        super.open(openContext);
        sessionIds = new ArrayList<>(64);
        sessionIdsPerSnapshot = new ArrayDeque<>();
    }
{code}
also changes could be seen at 
https://github.com/apache/flink/pull/23058/files#diff-59e8c6f938bd5fed55424ceb712a4617c3bfd8b45ab6a941af51521f7eae69c6L96-L98

the problem with this change is that if someone extends from this class 
{{MultipleIdsMessageAcknowledgingSourceBase}} and calls 
{{super.open(<Configuration>)}} then now it will be redirected to 
{{org.apache.flink.api.common.functions.AbstractRichFunction#open}} and now 
variables stopped being initialized...

Exactly this happened with flink-connector-rabbitmq at 
https://github.com/apache/flink-connector-rabbitmq/pull/22

Since there are several places like that I think it should be explicitly 
mentioned what to do and how to check it during updates. The tricky thing is 
that the code still continues being compiled however some tests unexpectedly 
behave in unpredictable way...


> Deprecate RichFunction#open(Configuration parameters)
> -----------------------------------------------------
>
>                 Key: FLINK-32978
>                 URL: https://issues.apache.org/jira/browse/FLINK-32978
>             Project: Flink
>          Issue Type: Technical Debt
>          Components: API / Core
>    Affects Versions: 1.19.0
>            Reporter: Wencong Liu
>            Assignee: Wencong Liu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.19.0
>
>
> The 
> [FLIP-344|https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=263425231]
>  has decided that the parameter in RichFunction#open will be removed in the 
> next major version. We should deprecate it now and remove it in Flink 2.0. 
> The removal will be tracked in 
> [FLINK-6912|https://issues.apache.org/jira/browse/FLINK-6912].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to