Skip to content

Fix job execution breaking on upgrade and restart (2026.07.1) - #3

Merged
krlex merged 3 commits into
mainfrom
upgrade-blocker-2026-07
Jul 26, 2026
Merged

Fix job execution breaking on upgrade and restart (2026.07.1)#3
krlex merged 3 commits into
mainfrom
upgrade-blocker-2026-07

Conversation

@krlex

@krlex krlex commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Upgrading 2026.06.0 → 2026.07.0 left a platform that accepts jobs and runs none of them: every launch sat in pending, with only "not enough available capacity" to explain it.

Cause

For jobs to run on the node itself, default has to be a regular instance group holding an execution-capable instance. Two things broke that, and either alone was enough to hang every launch:

  • register_queue assigns instances only when it creates the group, so on an upgrade it assigned nothing.
  • The task pod re-ran provision_instance on every start, and that call hardcoded node_type='control' and re-registered default as a ContainerGroup — overwriting whatever the installer configured. That is also why the published workaround did not survive a restart.

Measured one variable at a time on a live cluster:

default group member node_type result
ContainerGroup none control runs (job pod)
regular none control pending forever
regular forail-node control pending forever
regular forail-node hybrid runs locally, 4 s

Change

Registration takes its intent from FORAIL_NODE_TYPE, which the chart and the Compose stack already set, and derives the default queue from it: an execution-capable pod gets a regular group containing itself, a control-only pod keeps the ContainerGroup. Both defaults are unchanged when the variable is unset.

Also adds a CI step that runs the Django functional tests inside the image being published — the test job only ever ran tests_standalone/, which stubs Django out.

Verification

  • 107 backend tests green in the built image (now enforced in CI before push)
  • Fresh 7-node cluster: install 2026.06.0 → helm upgrade → job successful in 78 s with a clean PLAY RECAP, no manual intervention; two rollout restart deploy/forail-task left the state untouched and the next job succeeded
  • Full Cypress regression against the upgraded install: 102 tests, 101 passing, 0 failing

krlex added 3 commits July 26, 2026 11:20
The Kubernetes self-registration branch of provision_instance hardcoded
node_type='control' and re-registered the default queue as a ContainerGroup.
The task pod re-runs that command every time it starts, and both calls
overwrite what is already in the database -- so a restart, an eviction or a
rolling upgrade silently undid whatever the installer had configured.

On an upgrade the two combine into a platform that runs nothing: the default
group is left without an execution-capable member, launches are accepted and
then sit in "pending" forever with only "not enough available capacity" to go
on. Measured on a live cluster, one variable at a time -- a regular group with
no member hangs, a regular group whose only member is node_type=control hangs,
and the same group with a hybrid member runs the job in four seconds.

Take the intent from FORAIL_NODE_TYPE, which the chart and the Compose stack
already set, and derive the default queue from it: an execution-capable pod
runs jobs itself and needs a regular group that contains it, a control-only
pod dispatches to a ContainerGroup. Both defaults are unchanged when the
variable is unset, so a multi-node install that has no opinion behaves exactly
as before.
The test job runs only tests_standalone/, whose modules stub Django out, so
nothing in CI ever exercised the real application -- the instance and
instance-group tests that cover how jobs get routed included. Installing the
full requirements on a runner is impractical (python-ldap and friends), but
the image about to be published already has the application installed. Run
them there, between build and push, so a regression stops the release instead
of shipping in it.
Also closes the changelog section that was still labelled [Unreleased] while
2026.07.0 was already published.
@krlex
krlex merged commit 37e2031 into main Jul 26, 2026
3 checks passed
@krlex
krlex deleted the upgrade-blocker-2026-07 branch July 30, 2026 14:05
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