Skip to content

fix: check workflow phase before reusing saved session - #9

Merged
Negashev merged 1 commit into
mainfrom
fix/check-workflow-phase-before-reuse
Aug 18, 2026
Merged

Negashev merged 1 commit into
mainfrom
fix/check-workflow-phase-before-reuse

Conversation

@Negashev

Copy link
Copy Markdown
Owner

Problem

When K8S_SESSION_STORE=true, the aldaas client saves the workflow name to a ConfigMap. On pod restart, it reads the ConfigMap and checks argo get. If argo get succeeds (workflow exists), it reuses the workflow — even if the workflow is in Failed or Error phase. This causes the client to hang waiting for a DB Service that will never come up.

Same bug exists in file mode (/tmp/aldaas) — the file persists the workflow name, and on restart the client reuses it without checking the workflow phase.

Fix

After argo get succeeds, also check the workflow phase via argo get -o jsonpath='{.status.phase}'. If the phase is Failed, Error, or any non-running/non-succeeded state, treat the saved workflow as invalid and re-provision a new one.

Applied in both places:

  1. K8S_SESSION_STORE=true branch (ConfigMap read)
  2. File mode branch (/tmp/aldaas read)

Backward compatible: if jsonpath returns empty (older Argo versions), the workflow is reused as before.

When K8S_SESSION_STORE or /tmp file contains a saved workflow name,
argo get may succeed even if the workflow is in Failed/Error phase.
This causes the client to hang waiting for a DB Service that will
never come up. Now we check the workflow phase and only reuse
workflows that are Running or Succeeded.
@Negashev
Negashev merged commit aa4f8b9 into main Aug 18, 2026
1 check passed
@Negashev
Negashev deleted the fix/check-workflow-phase-before-reuse branch August 18, 2026 00:25
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.

1 participant