Skip to content

[ISSUE-4203][Bug] Preserve quoted program args#4365

Open
hutiefang76 wants to merge 1 commit into
apache:devfrom
hutiefang76:codex/streampark-4203-quoted-program-args
Open

[ISSUE-4203][Bug] Preserve quoted program args#4365
hutiefang76 wants to merge 1 commit into
apache:devfrom
hutiefang76:codex/streampark-4203-quoted-program-args

Conversation

@hutiefang76

Copy link
Copy Markdown

What changes were proposed in this pull request

Issue Number: close #4203

This pull request updates FlinkConfigurationUtils.extractArguments(String) to split program arguments while preserving quoted segments. This prevents arguments such as Kafka properties.sasl.jaas.config='... username="user" password="pass";' from being split into multiple program arguments because of spaces inside the quoted value.

Brief change log

  • Add quote-aware splitting before delegating to the existing extractArguments(Array[String]) logic.
  • Keep existing array-based argument normalization unchanged.
  • Add a regression test for Kafka JAAS config values with spaces and nested double quotes.

Verifying this change

This change added tests and can be verified as follows:

  • Added PropertiesUtilsTestCase#testExtractProgramArgsKeepsQuotedKeyValueWithSpaces.
  • Verified the new test failed before the fix because the JAAS config value was split across multiple arguments.
  • Ran locally:
JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -s /tmp/codex-empty-maven-settings.xml -pl streampark-common -DskipITs -DskipRat -DfailIfNoTests=false -Dtest=PropertiesUtilsTestCase test

Result: Tests run: 3, Failures: 0, Errors: 0, Skipped: 0.

  • Ran the full streampark-common test target locally:
JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -s /tmp/codex-empty-maven-settings.xml -pl streampark-common -DskipITs -DskipRat -DfailIfNoTests=false test

Result: Tests run: 12, Failures: 0, Errors: 0, Skipped: 0.

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): no

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Program Args parsing exception

1 participant