Skip to content

Add Axum production startup and bounded shutdown - #406

Open
ChristianPavilonis wants to merge 23 commits into
issue-459-outbound-compatfrom
issue-392-396-production-hosting-spec
Open

ChristianPavilonis wants to merge 23 commits into
issue-459-outbound-compatfrom
issue-392-396-production-hosting-spec

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Current review readiness — 2026-11-10

Ready for review at the publication head below. All29 current hosted checks passed. Reviewers: aram356, prk-Jr, dhruv8sh.

Review transitions are independent of TS work and the combined integration audit; #462 remains draft. This current status supersedes historical draft-only prerequisites below without claiming unexecuted deployment/manual acceptance complete. All three reviewers are requested. Stack465 is the current grouping; #453 is excluded.

Current review-stack checkpoint

Publication head: 9f090e573206cf0d8c21c1ce0067afffd69f12db. This cleanup preserves the existing feature unit and PR identity. The additional change is the completed generated-native build correction: image-only code now follows the scaffold's existing Fastly-example selection, with no request-policy change. Its focused generator/native proof is retained; fresh per-branch hosted checks are not assumed green.

Review order: #275 → #406 → #407 → #409 → #414 → #422 → #439 → #454. Draft integration checkpoint: #462. New SDK/group/codec/phase development and unrelated TS work are not prerequisites or additions to this PR. Earlier notes below retain their original tested revisions and limits; they are not a whole-tree pass for this new head.

Earlier implementation and proof notes

RC refresh checkpoint, 2026-11-10

Current head: 1d8e42e1cba52610e6655965e9941f42680b53ab.

Current #275 hosting port, with bounded startup/config/ingress and existing callback/egress ownership retained. The invalid-present native-limit and Windows prefix-identity capture bugs found by review are fixed. Windows semantics were simulated at the private parser boundary, not run on Windows.

Fresh CI exposed missing fixture validator metadata, an always-compiled test listener helper and a trigger assertion still expecting main-only PRs. The fixture lock is synced, the helper now has the same test/test-utils gate as its caller, and the exact workflow test now requires all PR bases while retaining main-only push. No lint suppression or production/deployment trigger expansion. Parent proof includes 301 Axum unit tests, axum-only strict Clippy and 35 Node CI tests.

Draft pending fresh hosted checks and the combined RC audit. Two unchanged native default-parallel deadline misses remain recorded and unclassified; serial passes and untouched-foundation parallel passes do not clear them. No timing bound was relaxed. No deployment, main merge, security-alert dismissal or review-thread resolution occurred. Historical design/review context follows.


Summary

  • Add explicit production startup so required settings, stores, transport, and app-owned initialization succeed before accepting traffic. Keep permissive development entrypoints.
  • Extend the existing native HTTP/1 runner with SIGINT/Unix SIGTERM handling, tracked graceful draining, a finite shutdown budget, and forced non-success exit.
  • Add portable app-owned probes, shared typed startup config loading, retained handler state, and subprocess acceptance tests.

This PR is stacked on #275, with base branch docs/outbound-http-spec. The implementation started at 5527b58. It remains draft because #275 has advanced to 91f4af38, five parent-only commits beyond the common base 5527b58. Parent integration and re-audit, including the previously identified dev_server.rs conflict, remain outstanding. The recorded checks are for this branch, not integration with the current prerequisite. This relationship audit performed no merge or rebase. Integrate the current contracts and repeat affected validation before marking ready.

Changes

Crate / File Change
edgezero-adapter-axum/src/dev_server.rs, run_options.rs Explicit production and embedding APIs, prepared registries, app initializer, lifecycle ownership, signals, and bounded drain
Axum connection/service modules Private dispatch gate, live lifecycle reader, and graceful HTTP/1 connection shutdown
Axum config/KV stores Strict required config snapshots, explicit roots, same-name KV aliases, and redacted startup failures without delete-and-restart advice
edgezero-core/src/app.rs, router.rs Startup-only typed state insertion with copy-on-write isolation and old-admission invalidation
edgezero-core/src/extractor.rs, probe.rs Context-free typed config loading shared with request extraction, plus ordinary readiness/liveness actions
Native and portable test fixtures Real process signals, finite/forced drain, startup failure/redaction, embedding, restart persistence, aliasing, stopped-writer backup/restore, and projected read-only config
Production hosting design Contracts, acceptance boundaries, executed checks, and remaining integration/deployment work

Closes

Closes #392.
Closes #396.

Part of #391. This PR remains draft until the pending integration and acceptance work below is complete.

Remaining acceptance includes production adoption/storage guides, standalone release and Docker UID evidence, unreadable/unusable mount cases, retained-handle lock evidence, and the accepted-#275 re-audit.

Test plan

  • cargo test --workspace --all-targets
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --features "fastly cloudflare spin"
  • Full WASM adapter builds for Fastly, Spin, and Cloudflare
  • examples/app-demo workspace: cd examples/app-demo && cargo test --workspace --all-targets
  • Docs build: cd docs && npm run lint && npm run format && npm run build
  • Manual testing via edgezero serve --adapter axum
  • cargo test -p edgezero-core --all-targets
  • cargo test -p edgezero-adapter-axum --all-targets --all-features, including all 13 production-hosting subprocess tests
  • cargo check -p edgezero-adapter-spin --target wasm32-wasip2 --features spin
  • cargo check -p edgezero-core --test production_handlers --target <target> for wasm32-wasip1, wasm32-wasip2, and wasm32-unknown-unknown
  • git diff --check

Checks passed on this branch, not on a merge with the newer prerequisite. Native subprocess tests use debug fixtures and the current user's UID, not a release container image. Shutdown cancellation is cooperative; blocking application code still requires a supervisor hard-kill boundary.

Checklist

  • Changes follow CLAUDE.md conventions
  • No Tokio deps added to core or adapter crates
  • Route params use {id} syntax, not :id
  • Types imported from edgezero_core, not http
  • Store wiring goes through KvRegistry / ConfigRegistry / SecretRegistry
  • New code has tests
  • No secrets or credentials committed

TS cutover follow-up, November 11

Adds startup-only router installation without rebuilding application clocks, platform metadata, or admission/egress policies. This lets a prepared-store initializer assemble application routes before the listener is shared.

Current head: 1b5e361e4896ad098fc26925556eb58b52ecdbb6.

Local combined-RC qualification at 36f8e9c9c2c93661aaa73f2ca956cec3bc9e4c92: workspace tests 2,947 passed / 6 ignored; all-feature Axum 568 passed, including 36 production-hosting, 6 AWS startup and 4 celld startup cases; core doctests 19 passed / 13 ignored; strict workspace Clippy, formatting, feature compilation and Spin WASM check passed under Rust 1.98.1. Narrow TS consumer proof under Node 24.20.0: all four real proxy tests and typed prepared config/secrets/router startup passed. This is not final TS-stack/image/deployment qualification. Fresh hosted checks are still required.

Owned follow-up review checkpoint

@ChristianPavilonis
ChristianPavilonis force-pushed the issue-392-396-production-hosting-spec branch from 3ab2209 to 49ba021 Compare November 10, 2026 19:40
aram356 added a commit that referenced this pull request Nov 17, 2026
Brings #275 at ea2549f and the refreshed heads of #499, #460, #406,
#407, #409, #414, #422 and #439, including #422's stock-celld store
service and its merge into #439. Each PR merged the one below it, with
no conflicts on the way up, so this merge has no conflicts.
@ChristianPavilonis
ChristianPavilonis removed this pull request from stack #501 November 17, 2026 17:14
Bring in main's Fastly SDK 0.13.3 upgrade (#529) with Viceroy 0.22.0
and the Fastly CLI 17.2.0 upgrade (#531), with PR #275's exact pins at
0.13.3 and url 2.5.9, its Viceroy readiness repair on 0.22.0 and its
typed Image Optimizer unavailability check for SDK 0.13.3.
Bring in PR #275's installation of the wasm32-unknown-unknown target
before the Viceroy 0.22.0 readiness repair builds, which the fastly
wasm tests and Portable record contracts (Fastly) jobs need.
@aram356

aram356 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#495), I pushed 2f6e7f00 and e269d665, two merges of #460's new heads. 2f6e7f00 takes EdgeZero main's Fastly SDK 0.13.3 upgrade (#529), with Viceroy 0.22.0 and the Fastly CLI 17.2.0 upgrade (#531), with #275's exact pins at 0.13.3 and url 2.5.9, its Viceroy readiness repair on 0.22.0, its typed Image Optimizer unavailability check and its drain of declared uploads after an early response on Axum, and #460's SDK 0.13.3 notes (e8e1d9cb). e269d665 takes #275's d8cd85c8, which installs the wasm32-unknown-unknown target before the Viceroy 0.22.0 readiness repair builds, as the fastly wasm tests and Portable record contracts (Fastly) jobs need. Both merges had no conflicts.

Bring in PR #275's atomic conditional KV insert in the Viceroy readiness
repair, which the Fastly record contract's native race needs.
…rocesses

This carries the production_hosting.rs changes that PR #519 makes in
09b09d9 and d86a5d3 (prk-Jr) to the helpers and tests this PR owns:
the reservation/spawn lock, reserved_address() holding a bound but not
listening socket for "nothing answers" checks, the lock around signals
and client connects, and the failed-startup check that the host never
reached its listener bind. A released reservation could otherwise be
served by another test's host during a failed-startup check
("failed startup never accepts connections").

The hunks are byte for byte except reserved_address(), which binds
SocketAddr::from(([127, 0, 0, 1], 0)) because Ipv4Addr is not imported
here yet; PR #519's merge restores its Ipv4Addr::LOCALHOST line.
…istener

address() releases its reservation before the host binds, so another
test's listener can take the port first. ready() then accepted that
listener's 200, and later requests reached the wrong server; a decoy
listener on the released port reproduces the failure every time.

The fixture gains a /fixture-ready route that returns probe::readiness's
response plus the launching test's per-spawn token in x-fixture-spawn;
/ready itself is unchanged. Server keeps its command, and ready() polls
/fixture-ready and respawns the host on a fresh reservation when it
answers without the token or the host exits reporting a lost bind, at
most 3 attempts, then fails naming the cause. Server::addr() returns
the address the live host serves. Binding port 0 in the host and
reporting the address would remove the race at its source; that is a
larger change across every test.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#495), I pushed e0f19340, cb306f7c and 38cf420b.

  • e0f19340 merges Preserve outbound cache tags and borrowed readiness #460's new head, which brings feat: implement portable outbound HTTP and request lifecycle contracts #275's 41cdf035: it makes conditional KV inserts atomic in the Viceroy readiness repair, as the Fastly record contract's native race needs. It had no conflicts.
  • cb306f7c carries Fix macOS-only test fixture failures #519's production_hosting.rs changes from 09b09d9e and d86a5d32 to the helpers and tests this PR owns: the reservation and spawn lock, reserved_address() holding a bound but not listening socket for the "nothing answers" checks, the lock around signals and client connects, and the failed-startup check that the host never reached its listener bind. A released reservation could otherwise be served by another test's host during a failed-startup check. The hunks are byte for byte except reserved_address(), which binds SocketAddr::from(([127, 0, 0, 1], 0)) because Ipv4Addr is not imported here; Fix macOS-only test fixture failures #519's merge restores its Ipv4Addr::LOCALHOST line.
  • 38cf420b respawns a fixture host that loses its port to another listener. address() releases its reservation before the host binds, so another test's listener could take the port, ready() accepted that listener's 200, and later requests reached the wrong server. The fixture gains a /fixture-ready route that returns the readiness response plus the launching test's per-spawn token in x-fixture-spawn; /ready itself is unchanged. ready() polls /fixture-ready and respawns the host on a fresh reservation when it answers without the token or the host exits reporting a lost bind, at most 3 attempts, then fails naming the cause. Server::addr() returns the address the live host serves. A decoy listener on the released port reproduced the failure every time before this change.

Bring in PR #275's batch cutoff test fix, which advances the test clock
when the request arms its own deadline instead of after dispatch.
@aram356

aram356 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

For the identity integration branch (#495), I pushed b67e78b9, a merge of #460's new head that brings #275's 0e2a58ae, which fixes an intermittent failure of the batch cutoff test by advancing its clock when the request arms its deadline timer. It had no conflicts.

@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Review follow-up for 48097ab. Inline replies cover the CI gate, port handling, startup logging and diagnostics, shutdown policy, stores, and router replacement. A few points from the review summaries:

  • The Axum guide now distinguishes development, standalone production, and embedded production. It documents the production-only grace setting, the initializer and prepared stores, and app-owned probes. A closed lifecycle watch now drains the connection instead of spinning; there's an idle-connection regression test.
  • Dev KV failures use fixed categories instead of printing raw paths or sources. The guide explains that config NAME is validated but snapshot filenames use logical IDs. The file-wide ordering exemption and extractor indentation are fixed.
  • The test fixture still requires test-utils and the crate is not publishable. The probe rustdoc already limits its status table to cases where the handler runs; a native probe can get a connection failure before acceptance or after listener withdrawal.
  • The broader workflow triggers are already inherited from Preserve outbound cache tags and borrowed readiness #460, not part of this PR's current diff. The Fastly image-helper generator fix stays as a separate commit so native-only scaffolds don't regain Fastly-only code.
  • The immediate base is Preserve outbound cache tags and borrowed readiness #460. This PR includes startup-only App::set_router, now documented and tested. The PR description has not been rewritten. Axum: define a production server lifecycle with bounded graceful shutdown #392 and Axum: make production configuration and local storage explicit #396 still have acceptance work and should remain open through that work, including the accepted-foundation audit and release/container evidence.

Local verification passed: 20 hosting subprocess tests through the CI wrapper, Axum all-features tests, workspace all-target tests, strict workspace Clippy, WASM compile checks, workflow lint, and docs lint/format/build. One unchanged isolated-harness port-close test failed in the parallel suite and passed on its own. macOS and release/container acceptance were not rerun.

ChristianPavilonis added a commit that referenced this pull request Nov 30, 2026
Carry the selected Axum JSON ceiling through shared service preparation while preserving the hosting lifecycle and both sets of subprocess cases.

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review

Summary

Follow-up review at 48097ab1. 48097ab1 resolves every code-level blocking finding from the three earlier reviews. The hosting suite runs in CI, embedding leaves the host logger alone, the dev URL and bind categories are back, dev shutdown is SIGINT-only cancel again, and the guide matches. One earlier blocking item is still open, and it is only in the PR description: it still says Closes #392 / Closes #396. That's the only reason this is still changes requested.

😃 Praise

  • RunMode now sets the shutdown policy explicitly. Development cancels, embedded production drains with no signal handlers, and standalone production drains with SIGINT/SIGTERM. The listener source now only decides how the listener is acquired.
  • The new subprocess tests act as real controls. I changed the standalone-only init_logging guard so embedding also installs a logger, and repeated_embedding_keeps_the_host_logger_and_filter failed. I reverted the change afterwards.
  • KvOpenFailure / SnapshotOpenFailure replace the string-matched categories with typed reasons. I checked the redb 4.4.0 source: DatabaseAlreadyOpen is what the page manager returns on lock contention, so the "locked by another owner" assertion now tests lock detection.

Prior findings status

Prior finding Status Evidence at 48097ab1
Subprocess suite never runs in CI ✅ resolved test.yml:150-162 runs it through run_test_nonzero.sh; hosted workspace tests log shows running 20 tests … 20 passed, followed by the three WASM production_handlers checks
Port reservation race ✅ resolved Spawn/reserve lock plus token-checked respawn (production_hosting.rs:63-100, ready()); 7/7 default-parallel runs passed locally on macOS
Embedding installs a global logger; standalone installs it after App::build; build failure loses the startup …: prefix ✅ resolved dev_server.rs:1074-1078 installs the logger only for standalone, before App::build, and maps failure to startup configure: application: assembly failed; mutation control above
Dev startup lost listening URL / every bind error reads "address unavailable" ✅ resolved announce_ready logs native server ready on http://{bound} for dev binds; adopt_listener (dev_server.rs:546-561) maps in-use / not-available / permission-denied separately
Dev Ctrl-C/SIGTERM behaviour change, serve() takes over SIGTERM, guide stale ✅ resolved Signals::register registers SIGTERM only for ProductionStandalone (dev_server.rs:354); development clears tasks without a drain; legacy_dev_leaves_sigterm_to_the_host / legacy_dev_ctrl_c_cancels_without_a_drain_budget; axum.md "Choose an entrypoint" and "Production shutdown"
Closes #392 / Closes #396 with acceptance work remaining 🔧 still open PR body unchanged; closingIssuesReferences still lists #392 and #396 (see Blocking)
🤔 App::set_router undocumented/untested (non-blocking) ✅ resolved Rustdoc at app.rs:591-596, guide paragraph, and startup_router_replacement_rejects_admission_for_a_different_router
⛏ PR body out of date (non-blocking) still open See below

Findings

Blocking

  • 🔧 PR still auto-closes #392 and #396: The description still contains Closes #392. / Closes #396., and GitHub lists both under closingIssuesReferences. The follow-up comment says both issues "should remain open" until acceptance is done (adoption/storage guides, release/Docker UID evidence, unreadable mounts, the #275 re-audit), and the design doc (line 425) says the same. When this stack lands on main, merging closes both issues, and the remaining acceptance work loses its tracker. Fix: change both lines to Part of #392 / Part of #396. No code change needed.

Non-blocking

  • 🤔 Dev bind failures no longer name the address (dev_server.rs:559, inline).
  • ⛏ PR description is still stale: It has three different "current head" values (9f090e57, 1b5e361e, a13f68a0), still says it "remains draft", and the Changes table doesn't list App::set_router, PreparedStores, AxumRunOptions or the probe module. Please rewrite the top of the description for 48097ab1 when you fix the closing keywords.

📌 Out of Scope

  • The generator image-helper fix (9f090e57) is still part of this PR. I'm fine with the reason given for keeping it.

CI Status

  • Hosted (head 48097ab1): all 29 checks pass, including workspace tests, which ran the 20 production-hosting subprocess tests and the WASM production_handlers checks.
  • Local (macOS):
    • fmt: PASS
    • clippy (Rust 1.98.1, -p edgezero-adapter-axum -p edgezero-core -p edgezero-cli --all-targets --all-features -D warnings): PASS
    • cargo test -p edgezero-adapter-axum --all-features: PASS (357 unit, 28 contract, 20 hosting)
    • cargo test -p edgezero-core: PASS
    • Hosting suite (--features axum,test-utils --test production_hosting, default parallel): 7/7 runs PASS
  • Not re-run locally: full workspace suite, Spin/Fastly/Cloudflare WASM builds, examples/app-demo.

} else {
"bind failed"
};
failure("bind", "listener", category)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Dev bind failures no longer name the address

The categories are right now, thanks. But on the dev path (run_app / AxumDevServer::run), the error used to say which address failed (failed to bind dev server to 127.0.0.1:8787: …). It now reads only startup bind: listener: address in use. The resolved address isn't logged before the bind either, so if EDGEZERO__ADAPTER__PORT was overridden somewhere, the developer can't see which port they collided on. In production, keeping the address out of the error is deliberate (occupied_bind_is_a_real_redacted_process_failure asserts it), but a dev bind address isn't sensitive. Not blocking. One option is to log binding http://{addr} at info level before adopt_listener when report_url is true.

Comment on lines +325 to +328
enum RunMode {
Development { ctrl_c: bool },
ProductionEmbedded(Duration),
ProductionStandalone(Duration),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😃 Making the shutdown policy an explicit RunMode fixes the earlier coupling between drain and listener source cleanly. Signals::register keys SIGTERM off ProductionStandalone only. Development and serve() are back to SIGINT-only cancel, and embedding registers nothing.

async move {
let metadata = A::stores();
options.validate_stores(metadata)?;
if matches!(mode, RunMode::ProductionStandalone(_)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😃 Installing the logger only in standalone mode, before App::build, resolves both logger issues. I checked that this guard is tested: with it changed to unconditional, repeated_embedding_keeps_the_host_logger_and_filter fails. I reverted the change afterwards.

)]
fn from_database(error: &DatabaseError) -> Self {
match error {
DatabaseError::DatabaseAlreadyOpen => Self::Locked,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😃 In redb 4.4.0, the page manager returns DatabaseAlreadyOpen when it can't take the file lock, so this mapping makes the "locked by another owner" assertion in the competing-writer test actually check lock detection. It no longer matches a catch-all message.

@dhruv8sh dhruv8sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review

Summary

This PR adds strict production entrypoints for Axum: run_production_app plus an initializer variant, and run_app_with_options plus an initializer variant for embedding. All of them run on one shared run_local/run_owned lifecycle owner. They add validated AxumRunOptions, required config/KV startup, lifecycle observation, a gate that blocks dispatch once draining starts, a bounded graceful drain, and portable probe helpers in core. The design is careful and well tested. I found no blocking issues, only a few non-blocking suggestions.

😃 Praise

  • Development and production now share one runtime owner, and dev behaviour is unchanged (Ctrl-C cancels immediately, no SIGTERM, no grace setting). The subprocess tests in production_hosting.rs show both behaviours.
  • Startup errors go through failure(stage, subject, category), which drops source chains, so neither provider errors nor setting values can leak into logs. The sentinel-based tests confirm it.
  • build_kv_registry and build_production_stores now reuse one handle when several ids resolve to the same store name. Before, aliased ids would hit redb's DatabaseAlreadyOpen.
  • Moving AppConfig extraction to from_binding, with secrets, limits and clock passed in, lets startup and request extraction share the same validation path.

Findings

Blocking

None.

Non-blocking

  • 🤔 Draining gate drops already-parsed requests with no response: a request that is already in flight when the phase changes is aborted (AxumIngressAbort), not answered with a 503 and Connection: close (crates/edgezero-adapter-axum/src/service.rs:195).
  • 🤔 Test fixture is shipped as a [[bin]] of the library crate, and test-utils now pulls in validator for downstream users (crates/edgezero-adapter-axum/Cargo.toml:70).
  • ⛏ Initializer failure category comes from Debug output (crates/edgezero-adapter-axum/src/dev_server.rs:1083).

📌 Out of Scope

  • probe::liveness/readiness document 200/503 responses for Starting and Draining. The native gate never dispatches in those phases, so the Axum adapter can't actually serve those rows. The docs already say "applies only if the handler executes". It may be worth tracking whether a later adapter should answer probes during drain.

) -> Result<Response<AxumEgressBody>, AxumIngressAbort> {
// This private gate defines dispatched work. Public extensions and app
// admission policy cannot admit new work after the owner starts draining.
if !self.admission_open() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Draining aborts already-parsed requests with no response: graceful_shutdown() stops hyper from reading new requests, but a request that was already read when the phase changes (for example a pipelined request, or one racing the signal) reaches this gate and gets AxumIngressAbort. The connection is then torn down with no response. The client sees a reset/EOF, so it can't tell whether the request was processed or is safe to retry.

If the runner is draining, a framework 503 with Connection: close (and possibly Retry-After) would tell clients the request was never dispatched. That would also keep ordinary HTTP clients from seeing it as a transport failure. Not blocking; the current behaviour still never dispatches work after drain starts.

[target.'cfg(unix)'.dependencies]
libc = { workspace = true }

[[bin]]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Test fixture registered as a crate binary: edgezero-hosting-fixture is now a real [[bin]] target of the adapter library. Because of it, test-utils also enables dep:validator (line 34), which the fixture needs only through production_handlers.rs. Downstream crates that enable edgezero-adapter-axum/test-utils for their own tests will now compile validator, and cargo build --all-features will build the fixture binary.

One option is a small unpublished workspace crate (for example crates/edgezero-adapter-axum-hosting-fixture) that owns the binary and the validator dependency. The integration test can then find it with CARGO_BIN_EXE_* from a dev-dependency, or by building it explicitly. That keeps the adapter's feature surface unchanged.

let transport = AxumOutboundClient::try_transport()
.map_err(|_error| failure("transport", "HTTP client", "initialization failed"))?;
initialize(&mut app, &stores).await.map_err(|error| {
let category = error.store_extraction_reason().map_or_else(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏ Error category derived from Debug: format!("{reason:?}") ties the operator-visible startup category to the derived Debug output of StoreExtractionReason. Renaming a variant or changing the derive would silently change log/error text that supervisors may match on. A stable as_str()/category() on the reason, like KvOpenFailure::category and SnapshotOpenFailure::category in this PR, would keep these categories consistent and avoid allocating here.

This branch has not been deployed

No deployments
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.

Axum: make production configuration and local storage explicit Axum: define a production server lifecycle with bounded graceful shutdown

4 participants