Skip to content

[FLINK-39711][runtime] Expose maxExceptions on exception message parameters#28202

Open
jubins wants to merge 2 commits into
apache:masterfrom
jubins:FLINK-39711-max-exceptions-query-parameter
Open

[FLINK-39711][runtime] Expose maxExceptions on exception message parameters#28202
jubins wants to merge 2 commits into
apache:masterfrom
jubins:FLINK-39711-max-exceptions-query-parameter

Conversation

@jubins
Copy link
Copy Markdown

@jubins jubins commented May 19, 2026

What is the purpose of the change

Fixes FLINK-39711 - the REST endpoint GET /jobs/:jobid/exceptions accepts an optional maxExceptions
query parameter that bounds the response size, but Java clients of Flink's typed
REST API could not set it: the corresponding MessageQueryParameter fields on
JobExceptionsMessageParameters and ApplicationExceptionsMessageParameters
were declared private. This forced downstream clients (e.g. flink-kubernetes-
operator) to fetch the full job exception history on every observation tick,
wasting network bytes, JobManager-side serialization time, and operator JVM memory
for long-running jobs with large exception histories.

Brief change log

  • Changed upperLimitExceptionParameter on JobExceptionsMessageParameters from
    private final to public final, matching the convention used by every other
    MessageParameters subclass (e.g. JobMessageParameters,
    JobMetricsMessageParameters, JobVertexFlameGraphParameters).
  • Applied the same change to failureLabelExceptionParameter on the same class,
    which had the identical accessibility gap.
  • Applied the same change to upperLimitExceptionParameter on
    ApplicationExceptionsMessageParameters.
  • Server-side JobExceptionsHandler / ApplicationExceptionsHandler are
    unchanged — this only opens up the existing parameter to typed Java clients.

Verifying this change

This change is covered by new unit tests:

  • JobExceptionsMessageParametersTest — verifies that resolving
    upperLimitExceptionParameter and failureLabelExceptionParameter produces the
    expected query string on the rendered URL, and that optional parameters are
    omitted when unresolved.
  • ApplicationExceptionsMessageParametersTest — same coverage for the
    application endpoint.

Existing JobExceptionsHandlerTest continues to validate that the server-side
handler reads the parameter from the request.

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no — neither JobExceptionsMessageParameters nor ApplicationExceptionsMessageParameters carries an @Public/@PublicEvolving annotation. The change only widens field visibility, so it is source- and binary-compatible.
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no — it exposes an existing
    server-side query parameter to Java REST clients.
  • If yes, how is the feature documented? n/a
Was generative AI tooling used to co-author this PR?
  • Yes — Claude was used as a pair-programming assistant for discussing the approach and implementation structure. All code was written, understood, and verified by the author.

Generated-by: Claude Opus 4.7

…meters

The REST endpoint GET /jobs/:jobid/exceptions accepts an optional maxExceptions query parameter, but Java clients of Flink's typed REST API could not set it: the corresponding MessageQueryParameter fields on JobExceptionsMessageParameters and ApplicationExceptionsMessageParameters were declared private.

This forced downstream Java clients (e.g. flink-kubernetes-operator) to fetch the full job exception history on every observation tick, wasting network bytes, JobManager-side serialization time, and operator JVM memory for long-running jobs with large exception histories.
@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented May 19, 2026

CI report:

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

… rendering

Covers the newly accessible upperLimitExceptionParameter and failureLabelExceptionParameter fields on JobExceptionsMessageParameters, and upperLimitExceptionParameter on ApplicationExceptionsMessageParameters, by asserting end-to-end URL rendering via MessageParameters.resolveUrl. Also verifies that unresolved optional parameters are omitted from the rendered URL.
@spuru9
Copy link
Copy Markdown
Contributor

spuru9 commented May 20, 2026

@jubins The CI is failing, changes need a lint fix.

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.

3 participants