You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "viczkdong (Jira)" <ji...@apache.org> on 2021/10/16 01:24:00 UTC

[jira] [Commented] (FLINK-24568) Configuration equals method does not properly check equality

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

viczkdong commented on FLINK-24568:
-----------------------------------

Can i fixed it??


---- Replied Message ----
Jessie Anderson created FLINK-24568:
---------------------------------------

            Summary: Configuration equals method does not properly check equality
                Key: FLINK-24568
                URL: https://issues.apache.org/jira/browse/FLINK-24568
            Project: Flink
         Issue Type: Bug
         Components: Runtime / Configuration
           Reporter: Jessie Anderson


Configuration's [equals|https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L938] method only checks the configuration keys of the object the method is called on, meaning that the method will still return true if the object passed as the function argument contains additional config parameters. For example:
{code:java}
Configuration a = new Configuration();
Configuration b = new Configuration();

a.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.parse("1024mb"));
b.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.parse("1024mb"));
b.set(TaskManagerOptions.KILL_ON_OUT_OF_MEMORY, true);

a.equals(b); // true
b.equals(a); // false {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


> Configuration equals method does not properly check equality
> ------------------------------------------------------------
>
>                 Key: FLINK-24568
>                 URL: https://issues.apache.org/jira/browse/FLINK-24568
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Configuration
>            Reporter: Jessie Anderson
>            Priority: Minor
>
> Configuration's [equals|https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L938] method only checks the configuration keys of the object the method is called on, meaning that the method will still return true if the object passed as the function argument contains additional config parameters. For example:
> {code:java}
> Configuration a = new Configuration();
> Configuration b = new Configuration();
> a.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.parse("1024mb"));
> b.set(TaskManagerOptions.TOTAL_PROCESS_MEMORY, MemorySize.parse("1024mb"));
> b.set(TaskManagerOptions.KILL_ON_OUT_OF_MEMORY, true);
> a.equals(b); // true
> b.equals(a); // false {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)