Repository navigation
fix(cli): let managed plan and apply requests wait for the --timeout deadline - #1208
Conversation
…deadline A managed plan or apply submission was sent under the fixed 10-second bound of every managed control request, and --timeout only wrapped it, so it could shorten the wait but never lengthen it. A plan whose preview capture took longer than 10 seconds was cut off by the CLI. The submission request now runs until the --timeout deadline. Source lookup and delivery polling keep the 10-second bound. Without --no-wait, a transport failure at or after the deadline is still reported as wait_timeout, since the request's own bound now ends at that deadline.
|
Recommendation: ready. WhyOn a managed target, WhatThe submission POST now runs until the How
The reqwest timer starts at
ImpactA plan or apply whose service answers after 10 seconds and before This is a client stopgap. The service still holds the HTTP call open until capture finishes. A proxy can still close that call. The lasting fix is for the managed control plane to accept the plan and report capture through status. This repository's server is the data plane. It does not serve Optional findingsNo blocking findings.
Tradeoff and liabilityCorrectness first. Simplicity next. The patch adds a duration argument the client already had ( The idempotency key is printed before the POST. The error body keeps it. This CLI sends the POST once. A retry with the same key is a later command. The user guide says that replay returns the same reservation and that a changed body is refused. This repository documents that contract. It does not implement the control plane that must enforce it. If the service stores the key only when it sends the response, a client that stops at the deadline can leave a capture running, and a new key can create a second plan. Lifecycle commands save the key on disk before send. Plan and apply do not. That gap is older than this change. This patch does not make the CLI retry. A connection may now stay open for up to 3600 seconds. The default is 300 seconds. Access JWTs are documented to last at most 15 minutes, and the bearer is fixed before Five more changes of this shape would leave five clock checks and five opinions about exit 1 versus exit 5. One helper that takes a deadline and returns a timeout distinct from a reset would keep the invariant in one place. Net effect: the change removes a client bound that contradicted ValidationReviewed head The regression test was copied onto the merge base, with the production fix absent. Temporary edits stayed in an isolated checkout and were removed. Nothing was pushed. Command, from the merge base, full test as in the pull request:
Result: failed in 10.53s. The plan case with The same command with only the The same command with only the Command, at the pull request head, after same Result: passed in 23.58s. That duration matches a 10.5s plan reply, a 10.5s LimitationsThe fixture is localhost TLS. It does not include a proxy timeout, a dropped connection at the deadline, or the managed control plane. The nightly workflow was not run here. Inline comment on Optional. This arm maps every The waiting path usually stops on Inline comment on Optional. This paragraph states exit 5 only when the command waits. With Inline comment on Optional. This third case already passes on merge base |
…ilton-996599 # Conflicts: # .github/workflows/tests-slow-nightly.yml # docs/user/cli/managed-lifecycle.md
|
Recommendation: ready. WhyThe new commit WhatOne local deadline covers the submission and the later poll. Pull request 1209 polls after the POST returns a preview id. A service that answers only after capture still needs this longer POST. A service that returns How
On the waiting path,
A preview-poll deadline is a different exit 5. DocsThe merged paragraph matches the bound. Submissions stay open until the Conflict resolution removed the sentence that a waiting submission deadline is exit 5 and that acceptance is unknown. The next paragraph is the poll resume from pull request 1209. It says to repeat Optional findingsNo blocking findings. Both earlier optional findings remain open.
Tradeoff and liabilityCorrectness first. Simplicity next. The patch adds a duration the client already had, and one clock check. It adds no queue, no stored plan, and no second publication path. The cost is two timers for one POST deadline, and a label that cannot see a timeout apart from any other transport error. The poll already has its own rule for The idempotency key is printed before the POST. A lost response means acceptance is unknown. This CLI sends the POST once. A later command with the same key is the resume. Pull request 1209 resumes a known preview by that same command. The two stories meet there. This repository documents the idempotent replay. The control plane that must enforce it is outside this repository. Five more changes of this shape would leave five clock checks. One flag on Net effect: the change removes a client bound that contradicted ValidationReviewed head The regression test was copied onto the merge base. The production fix was absent. Temporary edits stayed in an isolated checkout and were removed. Nothing was pushed. Command, merge base, full test:
Result: failed in 10.52s. The plan case with The same command with only the The same command with only the Command, at this head, built from that commit: same Result: passed in 23.60s. That duration matches a 10.5s plan reply, a 10.5s Also at this head:
Result: 51 passed, 0 failed, 6 ignored, in 1.61s. That run includes the plan replay, the exact GitHub LimitationsThe fixture is localhost TLS. It does not include a proxy timeout, a dropped connection at the deadline, or the managed control plane. The nightly workflow was not run here. Inline comment on Optional. Still open after the merge with pull request 1209. This arm maps every
Inline comment on Optional. This paragraph states the submission bound, and that bound matches the code. Conflict resolution removed the older sentence that a waiting deadline is exit 5 and that acceptance is unknown. The next paragraph is the poll resume: repeat Inline comment on Optional. Still open. This third case passes on merge base |
Summary
On a managed target,
omnigraph cluster planandcluster applysent their submission under the fixed 10-second bound of every managed control request.--timeoutonly wrapped that request, so it could shorten the wait but never lengthen it. The managed control plane answers a plan submission only once it has captured the preview, and that can take longer than 10 seconds. The CLI then dropped the connection, reportedtransport_failed ... exceeded its 10-second deadline, and the capture did not finish.The submission request now runs until the
--timeoutdeadline (default 300 seconds, maximum 3600). The source lookup thatplanmakes without--rev, and delivery polling afterapply, keep the 10-second bound.Without
--no-wait, reaching the deadline is still reported aswait_timeout(exit 5) with the idempotency key. Because the request's own bound now ends at that same deadline, a transport failure at or after the deadline is reported the same way, whichever timer fires first.This is a stopgap. The lasting fix belongs in the managed control plane: accept the plan without holding the request open for the capture, and report the preview's progress through its status. Once that lands, this change stays harmless, because the submission simply returns sooner.
Tests
cli_cluster::managed_plan_and_apply_submissions_wait_until_their_local_deadline. Under--timeout 30, a plan reply held 10.5 s succeeds, and so does anapply --no-waitreply held 10.5 s. A--timeout 1plan held 2.5 s exits 5 withwait_timeout, keeping its idempotency key. Each case sends exactly one request. Onmainthe first case fails: exit 1,transport_failed ... exceeded its 10-second deadline. The test waits out a real 10-second bound, so it is#[ignore = "nightly: ..."]and enrolled intests-slow-nightly.yml.cargo test -p omnigraph-cli --lib managed::: 100 passed.cargo test -p omnigraph-cli --test integration cli_cluster::managed_: 50 passed.cargo clippy -p omnigraph-cli --all-targets --no-deps -- -D warnings -W clippy::dbg_macroandcargo fmt --all --checkon the pinned toolchain.Docs:
docs/user/cli/managed-lifecycle.mdstates the submission bound. The changelog note ischangelog.d/managed-plan-apply-wait-for-timeout.fixed.md.