Skip to content

Use the path name when updating worker state - #516

Open
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/use-worker-update-path-name
Open

sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/use-worker-update-path-name

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Problem

PUT /workers/{name} selects the worker using the JSON body's name instead of the path parameter. Omitting the redundant body name fails to update the requested worker, while a conflicting name can update a different worker. Even a nonexistent path succeeds when the body names an existing worker.

Change

Use the path name for the store lookup, consistent with the worker GET/DELETE routes and VM updates. Preserve authorization, mutable fields, persisted identity, and transaction behavior. Matching path/body requests continue to work unchanged.

Validation

  • 124 tests and 100 subtests passed across the broad suite excluding VM/runtime integration packages.
  • The controller package also passes with the race detector. Changed-code lint reports zero issues; git diff --check passes.
  • Four regression scenarios fail on unchanged production code. The matching-name control passes before and after.
  • Tests exercise the actual handler through Gin with a real temporary Badger store. They check missing/conflicting body names, a nonexistent path, targeted scheduling/heartbeat changes, unchanged identity, and preservation of an unrelated worker.

Go 1.27.1 on macOS arm64. No running controller, VM, external network, or real worker was used. No schema, dependency, or public API changes.

Reproduced against f101ade5d8fdcad5e9c346472698649e7107a715.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant