Repository navigation
fix(onlion): the fold budget became a deadline; the request line records the method - #134
Merged
Merged
Conversation
…records the method
Two production facts, both from log lines:
1. Every request since the stabilisation deploy reports execution: "inline" -
the Makers Node cloud function context has no waitUntil (documented
properties: uuid / params / env / clientIp / server). The waitUntil the
previous record cited belongs to Pages Edge Functions, a different runtime.
So "the fold runs after the response" never took effect; the accept folds
inline, and the 15:00 distribution (p50 1.02 s, tail 6.5 s) was that shape.
2. The fold budget was a start gate: `Date.now() - startedAt < foldBudget` only
decided whether a fold began, and a fold beginning at 19.9 s still ran a
whole partition rewrite plus a 32-record backfill. That is the 14:09-14:15
mechanism (Adds 11-25 s, tail 100.7 s, five 120 s kills, every stack in
foldPending).
foldPending now takes { deadline }, refuses to start past it, and checks it
between entries - stopping leaves the remainder in the log, which is safe
because the entry is already durable and folding is idempotent. The accept
passes startedAt + foldBudget, /admin/fold passes 100 s. The waitUntil branch
stays for runtimes that provide one; nothing depends on it.
Also: two /add and /search requests answered 404 in 24-47 ms on dead-cold
isolates (81 MB, SQLite never loaded). Those routes accept POST only, so they
were not work requests; nmg_request now carries method, so the next one is
identified instead of guessed.
Recorded in docs/decisions/implemented/2026-10-30-fold-budget-is-a-deadline.*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/decisions/implemented/2026-10-30-fold-budget-is-a-deadline.{md,zh-CN.md,terms.yaml}— supersedes the platform claim in2026-10-30-fold-runs-after-the-response.foldPending(env, userId, { deadline })refuses to start past the deadline and checks it between entries, leaving the rest of the batch in the log (safe: entry is durable, folding idempotent, next scheduled accept retries). Accept passesstartedAt + foldBudget;/admin/foldpasses 100 s.execution: "inline"on every request: the Makers Node cloud function context has nowaitUntil(documented:uuid / params / env / clientIp / server). The hook the previous round cited is a Pages Edge Function feature — different runtime. The fold-after-response never took effect; nothing depends on it now.nmg_requestgainsmethod(the two 404s at 16:59 were 24-47 ms on dead-cold 81 MB isolates — not POST work requests; this makes the next one identifiable instead of guessed).Not verified
Not yet deployed (local verify 37 PASS, CI pending). The fold deadline is bounded by construction but no burst has been re-measured; the 404 rows remain unexplained until a
methodvalue shows up.