The GitHub Actions job "Build Docker Image" on 
flink-kubernetes-operator.git/nihar4276.flink-39356 has failed.
Run started by GitHub user nihar4276 (triggered by nihar4276).

Head commit for run:
fb86c902c7197ae9a4731264b3c67ae92ee04343 / nihar4276 <[email protected]>
[FLINK-39356] Fix NPE during FlinkStateSnapshot cleanup when status is null

Problem:

A FlinkStateSnapshot deleted before the controller ever reconciled it has no
status, since the status is only initialized in reconcile(). The cleanup
path builds a FlinkStateSnapshotContext, which dereferences the status via
getStatus().toBuilder(), so cleanup() threw a NullPointerException before
entering its try block. The finalizer was never removed, leaving the
resource stuck in terminating state and blocking namespace deletion, with
the failed cleanup retried indefinitely.

Fix:

Return DeleteControl.defaultDelete() from cleanup() when the status is null.
Such a snapshot was never triggered against Flink, so there is nothing to
dispose of and the finalizer can be removed immediately.

Verification:

Added FlinkStateSnapshotControllerTest#testCleanupWithNullStatus, covering
both a savepoint and a checkpoint whose status is null.

Verified manually on a local minikube cluster: a FlinkStateSnapshot deleted
before the operator reconciles it now has its finalizer removed and the
resource disappears, instead of hanging in terminating state.

Report URL: 
https://github.com/apache/flink-kubernetes-operator/actions/runs/30974216858

With regards,
GitHub Actions via GitBox

Reply via email to