Skip to content

server2: give the nation composition the legacy wait - #2869

Draft
hwanjjang wants to merge 3 commits into
masterfrom
feat/2614-kma-nation-deadline
Draft

hwanjjang wants to merge 3 commits into
masterfrom
feat/2614-kma-nation-deadline

Conversation

@hwanjjang

@hwanjjang hwanjjang commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On EC2 (2026-11-07, 01:29-03:12 KST, all weather families native) /v000903/nation/KR answered the legacy child error page (response.statusCode=500 {"method":"getWeather"}) in 6 of 13 steady requests, every round after 02:52, and successful compositions took about 3 s. The nation backend assembles fifteen cities concurrently. Each city's inputs end at about 2.9 s under the observed source; the assemblies then queue for the KMA CPU admission (two permits). The composition's three-second deadline cut that queue. (KmaBackend::outcome also caps each city at its source's request budget: 8 s for the observed source used on EC2, 3 s for the default.)

Legacy gave each child request 9 s (route.nation.js: "못 받으면 다음 요청에 받도록 timeout을 길게 함"). Now:

  • Air and the national narrative keep a three-second budget (NATION_INPUTS); each city keeps its source's own input budget, as an ordinary weather request does.
  • The city answers have one absolute eight-second deadline (NATION_DEADLINE): KmaBackend::outcome_finishing keeps the inputs at the source's request budget and lets the CPU admission wait until that deadline, also for sources with the default three-second budget. Ordinary weather requests are unchanged.
  • A city that never answers is still the legacy child error page, at eight seconds; a city that fails (status 400 or more) is still its legacy error at once. The direct nation route has no outer deadline of its own.

Changes

  • nation/mod.rs: NATION_INPUTS (3 s) for air and the national narrative, NATION_DEADLINE (8 s) for the cities; the KMA city source uses outcome_finishing.
  • domestic/kma/backend.rs: outcome_finishing; outcome is unchanged in behavior.
  • Documents: S17c, docs/operations/server2-nation.md, the Archify nation sequence (regenerated).
  • Records: intent/, specs/, plans/issue-2614-kma-nation-deadline.md; declaration server2/config/tasks/KMA-NATION-DEADLINE.json.

Verification

  • tests/nation/deadline.rs (paused clock): slow cities compose all fifteen in legacy order (Red on master: mutation M1, three seconds); a stuck city is the legacy 500 page at exactly 8 s (M2, nine seconds, caught); on both versions air gets 3 s and every city 8 s; a composition ending at 3.5 s does not wait for a pending narrative (M5, narrative at the city deadline, caught).
  • tests/domestic/nation_city.rs (the KMA backend itself, default three-second source budget): inputs ending at 2.8 s and 400 ms assemblies on two CPU permits; four cities all answer after 3.1 s. Mutations M3 (admission at the input budget) and M4 (the city using outcome) fail it with Err(Provider).
  • Full cargo test --locked --workspace 1,217 passed, 0 failed, 7 ignored (before the last commit, which changed comments, documents and nation tests only; the nation suite then passed 17 of 17); cargo fmt --check, cargo clippy -D warnings, placement gate and artifact policy pass.
  • Archify: validate, deliver, strict check and browser check pass; the dark 1440x900 capture was inspected.

Decision for AK

  • A nation request may now wait up to 8 s for its cities before the legacy error page, instead of failing at 3 s. Legacy waited up to 9 s per city. Air and the narrative still wait at most 3 s.

Not in this change: the per-city S3 lookups and their cost, the size of the CPU admission, partial nation answers (legacy has none), and the other fixes of the EC2 report (#2866 restart reads, #2867 AirKorea refresh, #2868 minute page).

🤖 Generated with Claude Code

hwanjjang and others added 3 commits November 7, 2026 04:40
The nation backend assembled fifteen cities under one absolute
three-second deadline. On EC2 (2026-11-07) each city bounded its own
inputs at about 2.9 s and the assemblies then queued for the CPU
admission, so 6 of 13 steady compositions became the legacy child error
page. Legacy gave each child request 9 s; the composition now has 8 s,
within the 9-second gateway deadline. A city that never answers is still
the legacy error page, at eight seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first commit only lengthened the composition deadline, but each
city (`KmaBackend::outcome`) still capped its wait for the KMA CPU
admission at its three-second request budget, so the queued assemblies
seen on EC2 were still cut at three seconds (a test on the KMA backend
itself now shows `Err(Provider)` for that state). Nation cities now use
`outcome_finishing`: their inputs keep the request budget and the CPU
admission may wait until the eight-second nation deadline. Air and the
narrative keep the three-second input budget. The operations document
and the Archify nation sequence describe the split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review: the observed source gives city inputs its own budget
(stored reads up to 8 s), so only air and the national narrative have
the three-second nation budget; the documents, comments and diagram now
say so. A composition that ends at 3.5 s answers at once without waiting
for a pending narrative, on both mounted versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hwanjjang

Copy link
Copy Markdown
Collaborator Author

Cross-provider review (Codex gpt-6.1-sol, high): PASS at d1fa863 (third round, no open findings).

Recommended

  • ND-stale-deadline-docs: adopted. S17c, docs/operations/server2-nation.md, code comments and the regenerated Archify sequence state the split (air and narrative 3 s, each city its source's input budget, city answers 8 s).
  • ND-shared-budget-coverage: adopted. Budget test on both versions, and a late composition does not wait for a pending narrative.

Builder finding: KmaBackend::outcome caps each city at its source's request budget (3 s by default, 8 s for the observed source). Nation cities now use outcome_finishing, so the CPU admission may wait until the nation deadline for default-budget sources too (tests/domestic/nation_city.rs).

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