Skip to content

[FLINK-39970] Retry incomplete JobManager deployment deletion#1145

Open
stellagai wants to merge 1 commit into
apache:mainfrom
stellagai:codex/retry-incomplete-jm-deletion-oss
Open

[FLINK-39970] Retry incomplete JobManager deployment deletion#1145
stellagai wants to merge 1 commit into
apache:mainfrom
stellagai:codex/retry-incomplete-jm-deletion-oss

Conversation

@stellagai

Copy link
Copy Markdown

What is the purpose of the change

Kubernetes deployment deletion waits can fail or time out before the old JobManager deployment is fully removed. The operator currently logs these failures and continues reconciliation, which can submit a replacement cluster while the old deployment is still terminating and result in AlreadyExists errors.

Brief change log

  • Propagate non-404 errors while waiting for Kubernetes resources to be deleted.
  • Retry reconciliation instead of creating a replacement cluster before deletion completes.
  • Preserve the best-effort JobManager shutdown behavior before mandatory deployment deletion.
  • Update deletion error and timeout tests.

Verifying this change

This change added and updated tests and was verified with:

JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home \
  mvn -pl flink-kubernetes-operator -am \
  -DskipITs \
  -Dtest=AbstractFlinkServiceTest \
  -Dsurefire.failIfNoSpecifiedTests=false test

Tests run: 40, 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
  • The public API, i.e., is any changes to the CustomResourceDescriptors: no
  • Core observer or reconciler logic that is regularly executed: yes

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@stellagai
stellagai marked this pull request as ready for review June 23, 2026 01:00

@Dennis-Mircea Dennis-Mircea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. The fix itself is correct, but this overlaps heavily with #1138 (FLINK-39953), which targets the same root cause in the same deleteBlocking wait catch and the same shutdownJobManagersBlocking caller.

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