Repository navigation
Description
User Story
I run OpenShell's conformance suite with several tests at once on one shared gateway, the way teams share a gateway. I need provider update --wait on my sandbox to report ready when my update applies, even if someone else imports or deletes an unrelated provider profile at the same time.
Problem Statement
Importing or deleting any provider profile makes every in-flight provider update --wait in the workspace end with superseded (desired_state_changed) and exit 1. The update is not replaced: it still applies a moment later. sandbox provider attach --wait and detach --wait use the same readiness check, so they are likely affected too.
The docs define superseded as "a later change replaced the original request" (provider profiles). An unrelated profile import replaces nothing.
Impact / Why This Matters
- Any user's profile import or delete breaks every other user's
--waitin the same workspace. Scripts that depend on--waitfail at random. - The only workaround is to ignore
supersededand poll for the effect, which makes--waitpointless. conformance::providers::provider_file_open_update_and_detachfails in about 4 of 5 local runs with 4 workers, and passes alone. It's marked unsupported on every environment with more than one worker until this is fixed (test(e2e): port provider tests from e2e/rust to testkit #5657).
Acceptance Criteria
- Importing or deleting a profile that a sandbox's providers don't use does not change that sandbox's desired provider state, so a concurrent
--waitreportsready. - Changing the profile that a provider uses still supersedes that provider's in-flight
--wait. - The
tests/suites/unsupported.yamlentry forprovider_file_open_update_and_detachis deleted.
Reproduction Steps
-
Import a profile
files-demothat serves a file:id: files-demo display_name: Files files: - path: client.toml env_var: ACME_CONFIG_FILE content: | project = "{{config.project}}"
-
Create a provider from it and a sandbox that uses it:
openshell profile import --file files-demo.yaml openshell provider create --name files-demo --type files-demo --config project=production openshell sandbox create --name sb-demo --provider files-demo --no-tty --detach -- sleep infinity
-
Update the provider and wait. It reports
readyand exits 0:openshell provider update files-demo --config project=one --wait --timeout 90
-
Update it again, and import an unrelated profile while the wait runs:
openshell provider update files-demo --config project=two --wait --timeout 90 & sleep 0.3 printf 'id: unrelated\ndisplay_name: Unrelated\n' > unrelated.yaml openshell profile import --file unrelated.yaml wait
The update reports
sb-demo / files-demo: superseded (desired_state_changed)and exits 1. This happened 3 times in 3 trials. -
openshell sandbox exec -n sb-demo -- cat /run/openshell/providers/files-demo/client.tomlshowsproject = "two"a moment later.
Environment
- OpenShell: main at 152c59d
- OS: macOS, Docker Desktop
- Runtime, deployment, or integration: Docker gateway from
e2e/with-docker-gateway.sh
Agent Investigation
- A provider's desired identity includes
provider_env_revision(compute_provider_env_revision_from_records_and_policy_bindingsincrates/openshell-server/src/grpc/policy.rs). - That hashes the provider's profile entry through
hash_scoped_profile_revision(crates/openshell-server/src/provider_profile_sources.rs), which includesentry.source_revision. - For stored profiles,
source_revisionisprofile_snapshot_revision: one hash over every profile in the snapshot. So any profile import or delete changes every provider's revision, and readiness reportssupersededfor every in-flight wait. - Hashing only the provider's own profile entry (which
hash_scoped_profile_revisionalready does throughcanonical_provider_profile_bytes), without the whole-source revision, would likely fix it.
Activity
test(conformance): mark the provider files test unsupported where con…
test(conformance): mark the provider files test unsupported where con…
test(conformance): mark the provider files test unsupported where con…