Skip to content

store: tell a missing workload by its gRPC NotFound code - #142

Merged
CMGS merged 1 commit into
masterfrom
fix/workload-exists-notfound
Sep 29, 2026
Merged

CMGS merged 1 commit into
masterfrom
fix/workload-exists-notfound

Conversation

@CMGS

@CMGS CMGS commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

WorkloadExists decided that a workload was gone by string-matching core's error text: either bad \Count` value, entity count invalidorworkload not exists`. Both strings are implementation details, and the first one disappeared in projecteru2/core#756.

With projecteru2/core#757, core answers GetWorkload for a missing workload with the standard codes.NotFound. This PR switches the check to that code.

  • Classification. It moves into workloadLookupResult(err):
    • nil means the workload exists.
    • codes.NotFound means it is gone.
    • Anything else is an error. That includes the old per-RPC code 1051.
  • Imports. The coretypes import is gone. google.golang.org/grpc becomes a direct requirement at the same version (v1.83.2).
  • Test. TestWorkloadLookupResult covers found, NotFound, the legacy per-RPC code and a transport error.

Deploy order. Upgrade core to a release that contains #757 before this agent. Against an older core, a missing workload comes back as code 1051. The agent then reports an error instead of "gone". The monitor treats that as not confirmed and leaves the workload alone (monitor.go: ownErr == nil && !owned), which is the safe side.

Gates (GOWORK=off)

  • make fmt-check: passes.
  • make lint: 0 issues on linux and darwin.
  • asl: clean on linux and darwin.
  • make test, make build: pass.

WorkloadExists string-matched core's error text (bad `Count` value / workload not exists). core now answers GetWorkload for a missing workload with codes.NotFound (projecteru2/core#757), so the check reads the status code; any other code, including the old per-RPC 1051, stays an error.
@CMGS
CMGS merged commit 3f92673 into master Sep 29, 2026
3 checks passed
@CMGS
CMGS deleted the fix/workload-exists-notfound branch September 29, 2026 07:39
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