Skip to content

Answer a live call after one database round trip, and fix round 6's deploy rough edges - #49

Merged
qfeuilla merged 3 commits into
mainfrom
deploy
Oct 4, 2026
Merged

qfeuilla merged 3 commits into
mainfrom
deploy

Conversation

@qfeuilla

@qfeuilla qfeuilla commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

What changes

A live call reaches the database once before the worker has it.

  • The entry's limits and the run's birth are one call to Postgres (weft_start_execution, weft_admit).
  • The rows every call used to read are held in each dispatcher's memory, and Postgres announces any change to every replica: a tenant's routes, the install's domains, a project's worker settings, its infra status.
  • A refusal is always made on the rows themselves, and nothing is held while the listening connection is down.
  • Locally, a warm call went from 88 statements (20 one after another before the worker) to about 28, with one before the worker.

Every birth is one round trip. Live calls, fires, manual runs and setups all go through the same SQL function. The journal lock and the dedup lock are each spelled once, in SQL.

Worker journal writes go out in the background, in order.

  • The run only waits for them before it reads its journal, before it hands something to the dispatcher (a task, a tag, a stop), and when it ends.
  • A part of a write that never reached the broker is sent again for up to a minute. Any other failure stops the run at once.
  • Cost records stay out of the run's order.

Token guessing. The bound costs a good live caller nothing, and a blocked address still gets 429 whatever the gate said.

Smaller items (Tangle round 6):

  • The broker reads a claimed execution's scope while it claims it.
  • The database node asks for its endpoints and its connection at the same time.
  • A hosted frontend gets no token until its deploy workflow puts its first one in place.
  • weft target export only says an old token keeps working when there is one.
  • weft status names the version each trigger fires.
  • weft tree, weft events and weft logs print UTC.
  • weft tree says what started a run.
  • The workflow template pins ubuntu-24.04.

Schema

There is one released migration per changed group, written with ./setup.sh --migration live_call_one_round_trip --release:

  • entry_rate
  • exec_event
  • infra_node
  • project
  • project_frontend
  • task
  • trigger_activation

Tested

  • Unit tests of every touched crate.
  • Workspace clippy.
  • 42 database tests, including schema_agreement, the admission and birth tests, and the change notifications.
  • The PostgresDatabase node tests.
  • Nine e2e tests:
    • entry_limits
    • api_reply (2)
    • api_auth
    • api_ticket
    • api_unrecorded
    • postgres
    • infra
    • steer_by_tag::abort_takes_the_asker_down_too

…n the background, and fix round 6's deploy rough edges

- A live call reaches the database once before the worker has it: the
  entry's limits and the run's birth are one call (weft_start_execution,
  weft_admit), and the rows every call read (a tenant's routes, the
  install's domains, a project's worker settings, its infra status) are
  held in each dispatcher's memory and dropped when Postgres announces a
  change. A refusal is made on the rows themselves, and nothing is kept
  while the listening connection is down.
- Every birth (live calls, fires, manual runs, setups) is one round trip,
  and the journal lock and the dedup lock are each spelled once, in SQL.
- A worker's journal writes go out in the background, in order; the run
  waits for them only before it reads its journal, hands something to
  the dispatcher (a task, a tag, a stop) or ends. A part of a write that
  never reached the broker is sent again for up to a minute; any other
  failure stops the run at once. Cost records stay off the run's order.
- The token-guessing bound costs a good live caller nothing and still
  answers a blocked address 429 whatever the gate said.
- The broker reads a claimed execution's scope while it claims it, and
  the database node asks for its endpoints and its connection together.
- A hosted frontend gets no token until its deploy workflow puts its
  first one in place; `target export` says an old token keeps working
  only when there is one.
- `weft status` names the version each trigger fires; `weft tree`,
  `weft events` and `weft logs` print UTC; `weft tree` says what started
  a run; the workflow template pins ubuntu-24.04.
@qfeuilla
qfeuilla merged commit 1856da2 into main Oct 4, 2026
9 checks passed
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