Skip to content

server: fix bugs and remove duplication from #749 - #750

Merged
rakyll merged 1 commit into
mainfrom
cleanup
Nov 24, 2026
Merged

rakyll merged 1 commit into
mainfrom
cleanup

Conversation

@rakyll

@rakyll rakyll commented Nov 24, 2026

Copy link
Copy Markdown
Member

Part of #749: the bugs and the duplication. The small things are left for a follow-up. Stacked on #748; once it merges, this PR retargets to main.

Bugs

  • -template and -template-atespace are removed: TaskManager stored them but never read them. This also removes them from NewTaskManager, the deploy/ax-server.yaml args, the namespace rewrite in deploy/embed.go, and test/e2e/manifests/ax-server.yaml. A new ax-server started with an old manifest that still passes --template fails with "flag provided but not defined"; manifests rendered by the matching CLI are fine.
  • UpdateModel treats only store.ErrNotFound as a new model. Before, any store error gave an existing model a new uid and createTime. TestUpdateModel_StoreError covers it.
  • recordFailure logs a failed status write instead of ignoring it.

Duplication

  • lockStoredTask replaces the lock, load, and NotFound/Internal mapping copied into DeleteTask, SuspendTask, and ResumeTask.
  • substrateError maps a Substrate error to Unavailable (transient) or Internal for SuspendTask, recordFailure, and DeleteWorkspace. deleteTask (passes Substrate's gRPC codes through) and prepareWorkspace (FailedPrecondition with the setup error) keep their own mapping.
  • defaultMetadata(meta, prev) takes the stored metadata instead of a callback.
  • atespaceOrDefault replaces the repeated defaulting, including the three hard-coded "default" in gateway.go.
  • The List handlers read the request with nil-safe getters.

DeleteGateway still reads the gateway before deleting it; the store is unchanged.

make verify, go build, and go test ./... pass locally. The E2E and local install tiers were not run.

@rakyll
rakyll requested a review from mayawang as a code owner November 24, 2026 06:42
@rakyll rakyll self-assigned this Nov 24, 2026
@rakyll
rakyll requested a review from yongruilin November 24, 2026 06:43
@rakyll
rakyll added this pull request to stack #751 November 24, 2026 06:43
Base automatically changed from taskSpecMatchesExisting to main November 24, 2026 21:13
- Remove the -template and -template-atespace flags, which nothing reads, from ax-server, NewTaskManager, and the deploy and E2E manifests.
- UpdateModel treats only store.ErrNotFound as a new model; other store errors return Internal instead of resetting the model's uid and createTime.
- recordFailure logs a failed status write instead of dropping it.
- Add atespaceOrDefault, lockStoredTask, and substrateError, and pass the previous metadata to defaultMetadata instead of a callback.
- List handlers read the request with nil-safe getters.
@rakyll
rakyll merged commit d47308b into main Nov 24, 2026
13 checks passed
@rakyll
rakyll deleted the cleanup branch November 24, 2026 21:30
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.

2 participants