git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (FLINK-10496) CommandLineParser arguments interleaving


eugen yushin created FLINK-10496:
------------------------------------

             Summary: CommandLineParser arguments interleaving
                 Key: FLINK-10496
                 URL: https://issues.apache.org/jira/browse/FLINK-10496
             Project: Flink
          Issue Type: Improvement
          Components: Configuration, Core, Java API
    Affects Versions: 1.6.1, 1.7.0
            Reporter: eugen yushin
            Assignee: eugen yushin


*Business case:*
Run Flink job cluster within Docker/k8s. Job takes an argument called `--config` which can't be recognized in runtime.

{code:java}
Caused by: java.lang.RuntimeException: No data for required key 'config'
{code}

*Problem statement:*
Command line parser can't recognize job specific arguments when they have the same prefix as Flink's ones.

e.g.
[https://github.com/apache/flink/blob/master/flink-container/src/test/java/org/apache/flink/container/entrypoint/StandaloneJobClusterConfigurationParserFactoryTest.java#L52]

the following args results in failure:
{code:java}
final String arg1 = "--config";
final String arg2 = "/path/to/job.yaml";{code}

*Reason*:
Apache CLI parser use string prefix matching to parse options and adds extra --configDir to result set instead of adding new --config.
https://github.com/apache/commons-cli/blob/cli-1.3.1/src/main/java/org/apache/commons/cli/DefaultParser.java#L391

*Scope*:
Update commons-cli dependency with version 1.4 which has flag to disable partial matching.
https://github.com/apache/commons-cli/commit/bdb4a09ceaceab7e3d214b1beadb93bd9c911342

Update Flink's command line parser to utilize this feature.
https://github.com/apache/flink/blob/6258a4c333ce9dba914621b13eac2f7d91f5cb72/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/parser/CommandLineParser.java#L45



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)