Task without spec crashes the controller with a nil-pointer panic
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia da internal/controller/worker.go:131 e confronta il percorso della specifica mancante con ValidateTask e Server.UpdateTask. Esegui TestReviewMissingSpecDoesNotCrashWorker da internal/controller/review_regression_test.go; il lavoro è completato quando un Task accettato contenente solo metadati non va più in panic durante l’elaborazione, usando il comportamento di validazione o inizializzazione scelto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
The API accepts a Task with no spec, but the controller dereferences task.Spec.Gateway before initializing the spec. Processing that task panics and terminates the controller process.
Reproduction
Apply a metadata-only Task:
apiVersion: ax.io/v1alpha1
kind: Task
metadata:
name: no-spec
ValidateTask accepts the missing spec. When the worker processes the resulting event, it panics at internal/controller/worker.go:131.
Expected behavior
Either reject the task at the API boundary with a validation error or initialize an empty spec before accessing its fields. An accepted task must not crash the controller.
Observed behavior
A local regression test submits the task through Server.UpdateTask, then processes it through Worker.Run:
API accepted metadata-only Task, then Worker.Run panicked:
runtime error: invalid memory address or nil pointer dereference
Test: TestReviewMissingSpecDoesNotCrashWorker
The test uses the production API and worker with an in-memory store and an in-process Substrate fake. The panic occurs before any Substrate RPC. The test source and its supporting fixture are published in the fork linked below.
Impact
One accepted metadata-only task can terminate a controller worker, interrupting reconciliation of other tasks.
Published regression test
TestReviewMissingSpecDoesNotCrashWorker. Supporting fixtures are in the same file and the repository's existing controller tests.
git clone --branch test/review-regressions https://github.com/fkautz/ax.git ax-review
cd ax-review
git checkout 1dc2613d29e12f306154a7e1183c1825a55d24ed
go test ./internal/controller -run '^TestReviewMissingSpecDoesNotCrashWorker$' -count=1 -v
Requires the Go toolchain specified in go.mod. No cluster or Redis instance is required. The test asserts no panic and fails on this revision. Panic recovery exists only in the test harness. Production code is unchanged.
- Lingua principale
- Go
- Stelle
- 2.1k
- Fork
- 121
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/ax
-
Better examples? Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
enhancement needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
kind/cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sympozium-ai/sympozium#627 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100