Recover saved Kubernetes terminal state#298
Open
nateGeorge wants to merge 1 commit into
Open
Conversation
Co-authored-by: AI (Pi/GPT-5.6 Sol) <noreply@pi.dev>
Ark-kun
reviewed
Jul 17, 2026
| ERROR = "ERROR" | ||
|
|
||
|
|
||
| class LauncherResourceNotFound(LauncherError): |
Contributor
There was a problem hiding this comment.
What's your plan for using this common exception in non-Kubernetes launchers?
| ERROR = "ERROR" | ||
|
|
||
|
|
||
| class LauncherResourceNotFound(LauncherError): |
Contributor
There was a problem hiding this comment.
Where is this exception used (caught)?
Comment on lines
-1470
to
-1473
| # There can be multiple pods for each index. | ||
| # This can happen when Job gets suspended and resumed multiple times and Pods can get stuck in "Terminating" phase. | ||
| # In this case we want to get the latest Pods. | ||
| # Alternatively, we could store all pods, but this can complicate the routines that determine status and get logs. |
Contributor
There was a problem hiding this comment.
Can you please explain what was your intent when making this change?
Comment on lines
+215
to
+221
| # Mark our active ExecutionNodes as SYSTEM_ERROR. | ||
| execution_nodes = [ | ||
| execution_node | ||
| for execution_node in running_container_execution.execution_nodes | ||
| if execution_node.container_execution_status | ||
| != bts.ContainerExecutionStatus.CANCELLED | ||
| ] |
Contributor
There was a problem hiding this comment.
Can you please explain this change?
| launcher_interfaces.ContainerStatus.FAILED, | ||
| ) | ||
|
|
||
| if not cached_snapshot_is_terminal: |
Contributor
There was a problem hiding this comment.
When is cached_snapshot_is_terminal true?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tangle now finishes from already-saved container state after a restart instead of trying to read a deleted Kubernetes resource. For Jobs, a finished parent result remains valid when child Pod details or logs are no longer available.
Draft follow-up #299 adds an opt-in single-node Job mode so Kubernetes can retain terminal state after a completed task Pod is removed.
Testing
.venv/bin/black --check cloud_pipelines_backend/launchers/interfaces.py cloud_pipelines_backend/launchers/kubernetes_launchers.py cloud_pipelines_backend/orchestrator_sql.py tests/test_kubernetes_terminal_recovery.py(passed)uv run --frozen --with-editable . pytest -q tests/test_kubernetes_terminal_recovery.py(34 passed)uv run --frozen --with-editable . pytest -q(471 passed, 16 warnings)git diff --check(passed)