Skip to content

[FLINK-39310][web-ui] Use programArgsList in JSON body instead of program-args query parameter#27825

Open
daguimu wants to merge 1 commit intoapache:masterfrom
daguimu:fix/web-ui-programArgsList-FLINK-39310
Open

[FLINK-39310][web-ui] Use programArgsList in JSON body instead of program-args query parameter#27825
daguimu wants to merge 1 commit intoapache:masterfrom
daguimu:fix/web-ui-programArgsList-FLINK-39310

Conversation

@daguimu
Copy link

@daguimu daguimu commented Mar 25, 2026

Problem

The Web UI's jar.service.ts uses the deprecated program-args query parameter (string) instead of the Flink 2.0 REST API's programArgsList (string array) in the JSON request body. This causes JAR submission with program arguments to fail on Flink 2.0+ — arguments are silently ignored or rejected because the server expects programArgsList in the request body.

Additionally, there was a pre-existing bug where the savepointPath query parameter was incorrectly set to the programArgs value instead of the actual savepointPath.

Root Cause

Both runJob() and getPlan() methods were sending parameters via HTTP query parameters with incorrect names (program-args, entry-class) instead of using JSON request body fields with the correct names expected by JarRunRequestBody/JarRequestBody (programArgsList, entryClass, etc.).

Fix

Updated both runJob() and getPlan() in jar.service.ts to:

  • Send parameters via JSON request body with field names matching the server-side JarRunRequestBody/JarRequestBody classes: entryClass, programArgsList, parallelism, savepointPath, allowNonRestoredState
  • Parse program arguments from a single input string into a string[] (programArgsList) with proper handling of single and double quoted arguments
  • Switch getPlan() from GET to POST with JSON body (both are supported by the server, POST is recommended per API docs)
  • Fix savepointPath bug where the query param value was incorrectly set to programArgs
  • Correct types: send parallelism as integer and allowNonRestoredState as boolean to match server-side expectations

Tests

The Flink web-dashboard Angular project has skipTests: true configured globally and no test framework (no Karma/Jest config, no .spec.ts files). Therefore:

  • Verified TypeScript compilation passes (tsc --noEmit)
  • Verified ESLint passes
  • Performed 3-round manual code review verifying field names match JarRequestBody.java and JarRunRequestBody.java
  • Existing Java-side tests (JarRunHandlerParameterTest, JarPlanHandlerParameterTest, JarHandlerUtilsTest) already validate the REST API handling of programArgsList

Impact

  • Only affects jar.service.ts in the web-dashboard
  • Fixes JAR submission with program arguments on Flink 2.0+
  • Fixes the savepointPath bug that was silently breaking savepoint restore on job submission
  • No breaking changes — the server already accepts the JSON body format

Fixes FLINK-39310

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 25, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

…gram-args query parameter

The Web UI's jar.service.ts was using the deprecated program-args query
parameter (string) instead of sending programArgsList (string array) in
the JSON request body, which is incompatible with the Flink 2.0 REST API.

This change updates both runJob() and getPlan() to:
- Send parameters via JSON request body with correct field names matching
  JarRunRequestBody/JarRequestBody (entryClass, programArgsList,
  parallelism, savepointPath, allowNonRestoredState)
- Parse program arguments string into a string array (programArgsList)
  with proper handling of quoted arguments
- Switch getPlan() from GET with query params to POST with JSON body
- Fix pre-existing bug where savepointPath query param was incorrectly
  set to programArgs value instead of savepointPath
- Send parallelism as integer and allowNonRestoredState as boolean to
  match server-side types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@daguimu daguimu force-pushed the fix/web-ui-programArgsList-FLINK-39310 branch from 7b0c21f to 86f7d53 Compare March 25, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants