Repository navigation
fix(gateway): bump wfaas to 1.0.2 so ContinueNextStep unblocks dependents - #37249
Conversation
…ents wfaas 1.0.0 signals StepResult::Failure for a step that failed with FailureAction::ContinueNextStep, even though the tracker records that step as skipped. The scheduler enqueues a step's dependents only on Success | Skip, so every step that depends_on it stays pending and the workflow ends in the deadlock branch as Failed. create_local_worker_workflow() is exactly that shape: discover_metadata declares ContinueNextStep and the rest of AddWorker hangs off it, so an optional metadata fetch failing keeps the worker from being registered at all. wfaas fixed this in 1.0.2 (published 2026-02-23). The gateway missed it because sgl-project#19224 pinned the internal crates from ~1.0.0 to =1.0.0 the following day, to stop unrelated patch releases from breaking the Docker CI build. The 1.0.0 -> 1.0.2 delta contains no public API changes.
|
/tag-and-rerun-ci |
ShangmingCai
left a comment
There was a problem hiding this comment.
Verified independently against the published crates rather than the write-up:
sgl-model-gateway/Cargo.toml:87does pin=1.0.0.- In
wfaas-1.0.0/src/engine.rsthe signal is computed fromresultbefore theContinueNextSteparm maps the step toskipped, so it sendsStepResult::Failure; the scheduler enqueues dependents only onSuccess | Skip, and the run then takes the deadlock branch toFailed. Confirmed in the vendored source. create_local_worker_workflow()is exactly that shape (steps/worker/local/mod.rs:120), soregister_workersis unreachable oncediscover_metadatafails.- 1.0.2 carries the fix (
(StepResult::Skip, true)), and the published 1.0.0 -> 1.0.2 manifest delta is version + README + an inlined[lints]table; dependency requirements are byte-identical, and lints are capped to allow for a registry dependency anyway. No public API change, and there is no committedCargo.lockto update.
One nit on the framing rather than the change: in the HTTP path DiscoverMetadataStep swallows both HTTP and gRPC fetch errors (.ok(), then .unwrap_or_else) and returns Ok(Success) with empty labels, so a plain failing or refused /server_info does not trip this. What trips it is exhausting the 10 s step timeout across all three attempts -- a hanging connect on a cold-starting pod -- or the connection_mode context error. Still real and still not exotic, but narrower than "one flaky call".
I also checked the one behavior-change surface of the bump: create_mcp_registration_workflow is a chain of ContinueNextStep steps, so its downstream steps will now actually execute when connect_mcp_server fails. They each require mcp_client in the context and fail cleanly with ContextValueNotFound, and validate_registration still fails the workflow -- same terminal status, just extra warn lines. Nothing gets registered unconnected.
Note for anyone reading the checks: PR Test (SMG) shows skipped here even though run-ci is applied, because the label was added by github-actions[bot] with GITHUB_TOKEN (no new run) and pr-test-rust.yml gates on the frozen github.event.pull_request.labels payload, which a rerun replays unchanged. The post-merge push run on main bypasses that gate (github.event_name != 'pull_request'), so this lands with a full SMG run behind it.
Motivation
sgl-model-gatewaypinswfaas = "=1.0.0". In wfaas 1.0.0 and 1.0.1, a stepwhose failure action is
FailureAction::ContinueNextStepdoes not actually letthe workflow continue past it — any step that
depends_onit never runs.The mechanism, in
wfaas-1.0.0/src/engine.rs:ContinueNextStepis recorded in the tracker asskipped(line 748), but the value sent to the scheduler is computedseparately and is
StepResult::Failure(line 723).Success | Skip(line 817), so the dependents are never enqueued.
its deadlock branch and sets
WorkflowStatus::Failed(line 612).create_local_worker_workflow()insrc/core/steps/worker/local/mod.rsis exactly this shape:So when
discover_metadatafails — a newly started worker whose/get_server_infois slow to accept a connection is enough, since the step hasa 10 s timeout and three attempts — the whole
AddWorkerworkflow is markedFailed and the worker is never registered. That is the opposite of what
ContinueNextStepwas declared on that step to achieve: the metadata it fetchesis optional, and the worker should still be added without it.
We hit this in production on a fork of this gateway: a rolled pod was never
picked up, and the router served a stale worker set until it was restarted.
wfaas already fixed this in 1.0.2, published 2026-02-23:
The gateway never picked the fix up. Before #19224 the pin was
~1.0.0, whichwould have resolved to 1.0.2 automatically. #19224 changed all 11 internal
crates to
=1.0.0on 2026-02-24 — one day after 1.0.2 was published — to stopunrelated patch releases (
smg-wasm'sWasmModuleManager::new()return type,etc.) from breaking the Docker CI build. That was the right call for CI
stability, but the wfaas fix was collateral damage, and the pin has not been
revisited since.
Relationship to #32322
#32322 (open, mine) adds a periodic LIST reconcile to k8s service discovery.
Part of it,
forget_lost_registration, exists for exactly the state this bugproduces: membership in
tracked_podsrecords that anAddWorkerjob wassubmitted, not that it succeeded, so a pod whose workflow failed afterwards
stays tracked, is short-circuited out of the add path, and never reaches the
registry. That reconcile untracks such a pod so the next tick re-submits it.
The two are complementary, and neither depends on the other — they can land in
either order:
discover_metadatafailure still fails thewhole
AddWorkerworkflow. The pod is recovered, but only on a later resynctick, and again on every recurrence.
AddWorkerthat fails for some otherreason, or a pod whose event never arrives at all because the watch is dead
or silently stale, is still never recovered.
In short: #32322 makes this failure recoverable, and this PR removes one of its
most common causes.
forget_lost_registration's doc comment lists the causes itknew about (
detect_connection_modeexhaustingworker_startup_timeout_secs, afailing DP discovery, a workflow that never starts); the wfaas scheduler bug is
another, and unlike those it fires on a plain transient hiccup in one optional
HTTP call.
Modifications
One line in
sgl-model-gateway/Cargo.toml:1.0.2 is the smallest version that carries the fix, and it keeps the exact-pin
discipline #19224 introduced. The published
1.0.0 → 1.0.2delta is entirelynon-breaking — no public API changes at all:
src/engine.rsContinueNextStepsignal fix above; dedup ofpending_checkindices so adepends_on_anystep with several finishing dependencies still launches once;#[expect(clippy::disallowed_methods)]attributes; inline format argssrc/event.rs#[expect(clippy::disallowed_methods)]attributes onlyCargo.toml[lints] workspace = trueREADME.md(1.0.0 → 1.0.1 is metadata and a README only.) 1.1.0 is the current latest if
you would rather jump further, but it is a larger delta and 1.0.2 is sufficient
for this bug.
Verification
The bug, and the fix, against the published crates. Three tests against an
unmodified
wfaasdependency, varying only the pinned version. The first isupstream wfaas's own shape (
test_workflow_continue_on_failure, whose secondstep declares no
depends_on, so it would have run regardless); the second addsthe one thing that test never exercises, a dependent; the third is this
gateway's
AddWorkershape.AddWorkershape reachescreate_workerThe gate discriminates in both directions: it fails on the pinned version and
passes on the bumped one. The test file is short and self-contained; happy to
attach it or land it under
sgl-model-gateway/tests/if you would like aregression test in-tree.
Build.
cargo check --all-targetson this branch, toolchain 1.90 as pinnedby
rust-toolchain.toml.Accuracy Tests
Not applicable — no model output is affected.
Speed Tests and Profiling
Not applicable — no hot-path code changes. The dedup in 1.0.2 removes redundant
step launches, so if anything it does slightly less work.
Checklist
CI States
Latest PR Test (Base): ✅ Run #33387783065
Latest PR Test (Extra): ❌ Run #33387782754
Latest PR Test (AMD ROCm 7.2): ➖ No AMD PR run found for this commit.