Skip to content

Keep cold-start slots until the game is ready and retry unschedulable wakes - #1163

Open
Baylem wants to merge 2 commits into
masterfrom
fix/967-cold-wake-admission
Open

Baylem wants to merge 2 commits into
masterfrom
fix/967-cold-wake-admission

Conversation

@Baylem

@Baylem Baylem commented Nov 29, 2026

Copy link
Copy Markdown
Member

Fixes #967.

With a fleet limit of one, a Ready Pod could let a second world start loading while the first was still starting. At the other extreme, an unbound game Pod could occupy the only slot indefinitely. Both paths are present on master at f7303559. PR #1162 addresses the Service handoff to the sentinel as a game goes to sleep. This change targets cold-start admission and the handoff back to the waking game.

A limited wake now keeps its reservation until the current game container passes its configured readiness probe or answers a declared A2S or RCON player query. The agent includes the source Pod UID and observation time so a previous process’s response cannot qualify a restarted game. Service-backed wakes keep routing through the sentinel while the world loads.

When another game is waiting, the operator can withdraw a start that the scheduler reports as unschedulable. It records the reason, gates replacement Pods, and keeps the reservation until the StatefulSet has scaled to zero and its Pod has disappeared. If the scheduler binds the original Pod first, that game keeps its slot and continues starting. A parked wake must reserve capacity again to retry.

Upgrade impact. The default limit of zero stays unlimited. For a positive limit, configure a game readiness probe or a supported player query for each sleeper. A sleeper missing both stays queued with the reason in status.idle.reason. Update pinned agent images for games that rely on native queries.

Verification. The agent, operator, and changed Go test packages compiled locally for Linux amd64. Both Python files parsed, and the generated chart CRD copies matched. The Kind drill now measures Pod readiness separately from the first successful client join and exercises a delayed world, a same-Pod game restart, worker loss and recovery, and operator restarts with real Minecraft and Teeworlds clients. Runtime suites run in CI.

Signed-off-by: Baylem <zelathis@gmail.com>
@Baylem
Baylem requested a review from ValgulNecron as a code owner November 29, 2026 04:23
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f730355 and 5205ded.

Files selected for processing: 48

  • agent/cmd/main.go
  • agent/internal/heartbeat/heartbeat.go
  • agent/internal/heartbeat/heartbeat_test.go
  • agent/specs.md
  • changelog/unreleased/1163-cold-wake-capacity.md
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupexports.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backups.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_backupschedules.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_clusters.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gameservers.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_gametemplates.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modules.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_modulesources.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_networkcaptures.yaml
  • charts/gameplane/charts/gameplane-crds/crds/gameplane.local_restores.yaml
  • charts/gameplane/crd-manifests/gameplane.local_backupexports.yaml
  • charts/gameplane/crd-manifests/gameplane.local_backups.yaml
  • charts/gameplane/crd-manifests/gameplane.local_backupschedules.yaml
  • charts/gameplane/crd-manifests/gameplane.local_clusters.yaml
  • charts/gameplane/crd-manifests/gameplane.local_gameservers.yaml
  • charts/gameplane/crd-manifests/gameplane.local_gametemplates.yaml
  • charts/gameplane/crd-manifests/gameplane.local_modules.yaml
  • charts/gameplane/crd-manifests/gameplane.local_modulesources.yaml
  • charts/gameplane/crd-manifests/gameplane.local_networkcaptures.yaml
  • charts/gameplane/crd-manifests/gameplane.local_restores.yaml
  • charts/gameplane/templates/operator.yaml
  • charts/gameplane/values.yaml
  • docs/module-authoring.md
  • docs/wake-qualification.md
  • operator/api/v1alpha1/gameserver_types.go
  • operator/api/v1alpha1/zz_generated.deepcopy.go
  • operator/config/crd/gameplane.local_gameservers.yaml
  • operator/internal/controller/gameserver_controller.go
  • operator/internal/controller/gameserver_idle.go
  • operator/internal/controller/gameserver_sentinel.go
  • operator/internal/controller/gameserver_sentinel_test.go
  • operator/internal/controller/gameserver_wake_admission.go
  • operator/internal/controller/gameserver_wake_admission_test.go
  • operator/internal/controller/gameserver_wake_parking.go
  • operator/internal/controller/gameserver_wake_readiness.go
  • operator/internal/controller/gameserver_wake_readiness_test.go
  • operator/specs.md
  • test/e2e/cold_wake_fleet_e2e_test.go
  • test/e2e/gamebot_helpers_e2e_test.go
  • test/e2e/lint-gate-verify.sh
  • test/e2e/test_wake_burst.py
  • test/e2e/wake_burst.py
  • web/src/types.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Baylem Baylem added type: fix Bug fix area: operator controller-runtime operator and CRDs area: agent in-pod sidecar area: modules game template OCI bundles area: e2e kind-based end-to-end suite labels Nov 29, 2026 — with ChatGPT Codex Connector
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

CI Report - 5205ded

run 46230654454 - attempt 1

0 failed - 29 passed - 4 skipped - 47m43s elapsed

Test selection: partial - per-suite table

Coverage

no coverage/* commit statuses found on 5205ded

Changed

Area Files +/-
operator/ 13 +1176/-30
test/ 5 +376/-54
agent/ 4 +115/-20
charts/ 22 +62/-23
docs/ 2 +59/-25
changelog/ 1 +3/-0
web/ 1 +1/-0

Slowest jobs

Job Duration
e2e telemetry / arm64 (kind) 24m4s
e2e telemetry / amd64 (kind) 22m42s
e2e postgres / amd64 (kind) 20m58s
e2e restricted-workloads / arm64 (kind) 15m17s
build e2e images 15m3s

e2e buckets run

api-agent, api-auth, api-mods, api-rbac, api-roles, backup-archives, backup-preparation, bot-fast, management-placement, monitoring, multicluster, network-isolation, operator, optional-components, postgres-availability, postgres-ha, postgres-pitr, ratelimit, recovery, restricted-workloads, sftp, standalone, telemetry, themes, upgrade, wake-hostport

Signed-off-by: Baylem <zelathis@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agent in-pod sidecar area: e2e kind-based end-to-end suite area: modules game template OCI bundles area: operator controller-runtime operator and CRDs type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep cold-start slots until the game is ready and let placeable wakes progress past blocked starts

1 participant