Repository navigation
Expose live Substrate actor UIDs in task status and describe output - #556
Conversation
…e links, and actor UID (google#526, google#556)
2bf0e6b to
05bda21
Compare
05bda21 to
6d1eafc
Compare
|
Really thorough work, and the crashed-worker demo is great. Two design questions before approving: this stores residency and the actor UID again, which #515 moved away from (and the stored copy can drift on router wakes, same as #502). And #563 is about to reshape task status, so it'd be good to land these fields as part of that. @rakyll @yongruilin how do you want to sequence it? The actor UID for joining with Substrate logs seems useful on its own either way. |
|
Thanks @mayawang , that makes sense. Reads still use live Substrate state, but the stored copy can drift, so your concern is valid. To get this into a mergeable shape, I can narrow it to exposing the actor UID from live reads, without storing another copy, and leave residency and outcome to #563. We can align the UID field with that schema too. Would that smaller scope work? |
|
Yes, that works great, thanks! UID from live reads now, residency and outcome with #563 |
Read actor identity alongside the existing live actor status and show it in task descriptions so operators can correlate Substrate telemetry. Strip the UID from stored status and clear it when the actor cannot be read.
6d1eafc to
7a146fb
Compare
mayawang
left a comment
There was a problem hiding this comment.
Thanks for narrowing it, LGTM
…e links, and actor UID (google#526, google#556)
…e links, and actor UID (google#526, google#556)
Task status identifies the Substrate actor by name, but does not expose its UID. Names can be reused when an actor is recreated, so operators cannot reliably match a task to the actor identity in Substrate logs and events (
ate.actor.uid).This adds
status.actorUidto task responses and anActor UIDline toax describe task <name>.Design and scope
The UID follows the live-read design established in #515: gets and lists read it from the current Substrate actor, and every task store write strips it. A recreated actor's new UID appears on the next read. If the actor is missing or Substrate cannot be reached, the UID is empty and
describeshows<none>rather than a stale identity.actor_uiduses protobuf field 23 to avoid the field numbers in #563's current status schema sketch. Residency and outcome remain with #563. This contributes the actor identity needed for #13; it does not add telemetry events or command-exit detection.Tests
<none>display.make verify, builds of the CLI/server/task runner,go test -count=1 ./..., and race tests for./internal/serverand./cmd/axpass. The ordinary local test run skips the opt-in Postgres and E2E tiers.Live validation
Setup: A separate disposable Kind cluster with Agent Substrate v1.0.0 from its release images, four gVisor workers, PostgreSQL, and AX binaries/images built from this change.
Actions:
TestE2E_TaskLifecycleAndSubstrateSynccreates a suspended task, compares its reported UID with the real Substrate actor's nonempty UID, and checks thatax describe taskprints the same value. It then resumes the task, checks readiness and the worker address, and deletes the task and its Substrate resources.Result: The focused live test passed, and the disposable cluster was removed. The missing/unreachable actor and recreation cases use in-process fixtures in the regression tests. GitHub's build-and-test job, including the Postgres tests, and full Kind E2E suite also passed on
7a146fb.To repeat the focused live test, follow the E2E setup instructions and run:
make test-e2e E2E_ARGS='-test.run TestE2E_TaskLifecycleAndSubstrateSync'This change was written with help from an AI coding assistant.