Skip to content

SparkApplication spec.failureRetries and spec.retryInterval have no effect #3330

Open

Description

@bhavishyajain545

What happened?

  • ✋ I have searched the open/closed issues and my issue is not listed.

SparkApplicationSpec documents two retry fields in api/v1beta2/sparkapplication_types.go:

  • failureRetries: "the number of times to retry a failed application before giving up"
  • retryInterval: "the unit of intervals in seconds between submission retries"

On master (5a95d68) nothing outside the generated code (deepcopy, OpenAPI, Python models, API docs) reads either field. Retries are decided only from spec.restartPolicy (onFailureRetries, onFailureRetryInterval, onSubmissionFailureRetries, onSubmissionFailureRetryInterval), for example in pkg/util/sparkapplication.go. So setting spec.failureRetries or spec.retryInterval is accepted by the API server and changes nothing.

I found this by reading the code, not on a live cluster.

Reproduction Code

git grep -n "FailureRetries\|RetryInterval" -- '*.go' ':!*zz_generated*'

The only hits for Spec.FailureRetries / Spec.RetryInterval are the field definitions; every other hit is one of the RestartPolicy.On* fields.

A manifest like this is accepted and the two fields are ignored:

spec:
  failureRetries: 3
  retryInterval: 10

Expected behavior

Either the fields do what their descriptions say, or the API docs say they are deprecated and point to spec.restartPolicy.

Actual behavior

The fields are part of the CRD schema and the API reference with a working description, but the controller never reads them.

Environment & Versions

  • Kubernetes Version: n/a (found by reading the code)
  • Spark Operator Version: master at 5a95d68 (v2.6.0)
  • Apache Spark Version: n/a

Additional context

Which direction do you prefer: mark both fields as deprecated in the API docs (pointing to restartPolicy), or wire them up? I can send the PR for whichever you choose. Since it touches api/, I did not want to open a PR without asking first.

Impacted by this bug?

Give it a 👍 We prioritize the issues with most 👍

Activity

  1. added
    kind/bug
    on Nov 21, 2026
  2. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor

    🎉 Welcome to the Kubeflow Spark Operator! 🎉

    Thanks for opening your first issue! We're happy to have you as part of our community 🚀

    Here's what happens next:

    Join the community:

    Feel free to ask questions in the comments if you need any help or clarification!
    Thanks again for contributing to Kubeflow! 🙏

  3. vikas-saxena02 commented on Nov 28, 2026

    @vikas-saxena02
    Contributor

    Thanks for the report @bhavishyajain545, I can confirm this on current master (1892648). The only references to spec.failureRetries and spec.retryInterval are the type definitions and generated code, nothing in the controller reads them. Retry behaviour has lived under spec.restartPolicy (onFailureRetries, onFailureRetryInterval, onSubmissionFailureRetries, onSubmissionFailureRetryInterval) for a long time now.

    My suggestion would be to deprecate rather than wire them up. Wiring them would give us two overlapping ways to configure the same thing with unclear precedence, and would change behaviour for anyone who has these set today and is (unknowingly) relying on them being ignored. Removing them outright would be a breaking change in v1beta2.

    We did the same thing for client deploy mode in #3270, so the pattern is already there:

    • add a // Deprecated: comment on both fields in api/v1beta2/sparkapplication_types.go pointing to restartPolicy
    • extend deprecationWarnings() in internal/webhook/sparkapplication_validator.go to return a warning when either field is set
    • regenerate CRDs/api-docs and add a release note
    • remove the fields in the next API version

    Happy for you to take the PR if you'd like. Would be good to get another maintainer 👍 on the direction first so that the effort on the pr is not wasted

    /cc @nabuskey @tariq-hasan @vjanelle

  4. bhavishyajain545 commented on Nov 28, 2026

    @bhavishyajain545
    ContributorAuthor

    Thanks for confirming, and for the pointer to #3270. Deprecating makes sense to me, for the reasons you gave.

    I'll wait for a maintainer to confirm the direction and then send the PR following the #3270 pattern: // Deprecated: comments on both fields pointing to restartPolicy, a warning from deprecationWarnings() when either field is set, regenerated CRDs and API docs, and a release note.

  5. rahulsjha commented on Nov 28, 2026

    @rahulsjha

    I'd like to work on this. Plan: either wire failureRetries and retryInterval into the retry logic when restartPolicy doesn't set them, or, if you'd rather keep restartPolicy as the single source, mark both fields deprecated in the API docs and CRD. I'm happy to go whichever way you prefer, with tests for it. Could a maintainer assign it to me?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions