The runtime hands each event and each tool call to a goroutine of its own (mesh-sdk stdio), and the gate applied them to the same in-memory records with no lock: Records.Outcome writes the ledger and only then memory, so a pipeline-wanted heard once a running's outcome was in the ledger ended the record before memory held that running, and timesAtEnd found no running: the record ended with no delivery time and no class (main.493's failure of TestAGateWhole...). The race detector names it: 9 reports in 30 runs on main, the running's Records.Outcome (record.go:759) against pipeline-wanted's timesAtEnd (movers.go:67). The fix, the thorough one for the kind (events and calls applied concurrently to one in-memory state): - take applies every event under Holder.applying; the ledger write and the memory write of an entry happen under it, so whatever is heard after the write lands waits until memory holds it too. - Holder.applied runs every tool call under the same lock and takes its answer (marshalled) under it, so a view of a kept record is never written out while the next event writes the record. - The bus test's bundle log fails the test on a data race the bundle reports under -race, a guard for every bus test of the gate. The quick fix, a lock around Records.End and Records.Outcome alone, was not taken: it leaves an event's several writes (pipeline-ended, take-in) interleaved with another's and the calls reading half-written records. Test: TestWhatIsHeardWhileAnEventIsWrittenWaitsUntilItIsApplied hears pipeline-wanted, and calls show, as the running's write lands; each of the three parts removed fails a row. Fixes: issue 721 note 11 Builds: design 47 H2 §810
mesh-delivery-gate
The mesh-delivery-gate module of the mesh catalogue: the gate of design 47. It claims the seat mesh-delivery, whose
name stays (ADR 0437 §11), and takes over from the module mesh-delivery (ADR 0437 §3, ADR 0450 §6). Its buckets are
mesh-delivery-gate_*.
Files it does not know
Each directory or archive this module declares says how it treats a file it did not write (ADR 0422, ADR 0416).
${dir:state}: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2).
What it keeps (ADR 0539 §17)
The gate keeps the merge's states: proposed, ready, rejected, merged, held (a merge that reached the trunk without a passing
check) and closed. It asks the operator's Approve and merges once, moving source.main. It asks the controller nothing, follows
no plan event and derives nothing after the merge: whether a merged change reached the machines is the view's, from
source.main, the wants and the haves. The seat mesh-delivery keeps the verbs deliveries, show, groups, checks,
table, stalled (for a merge or a check past its bound), recheck and close; times, what-if, release, stop and
retire-history went with the plans, so the gate stays a bundle serving the seat. A delivery an earlier owner kept in a state that
is gone is read as the state it came to (merged, closed or proposed) when the gate starts.
When a refused or rejected merge is said (ADR 0505 §4, §5)
stalled is what the gate says to the operator as conditions, itself, on the operator-channel seat (ADR 0437 §9, issue
1275): after every look it raises each line, raises it again when its severity or need changes, and clears each that is
listed no more; its bucket conditions keeps which it raised. (The controller's self-check that raised them went in
release 6.) The gate's own list (show, deliveries)
names every refusal and rejection at once, and the pull request is told at once; only stalled waits:
- a merge refused because its trunk moved, whose check the gate asked again, is stalled only once that check answered and
the merge was refused again, or twice the repository's last check time passed (at least the setting
refusal-stall-floor-minutes, 10). Every other refusal is stalled at once. - a delivery that needs its author's new head (its check failed after its Approve: a conflict, a failed check, a rejected
group) is stalled only once no new head came for the setting
author-new-head-minutes(120). Its line saysneeds: new-headand names its author: the branch, and who opened the pull request as the forge's record says (the seat git's events). The ask names the issues linked to each pull request in the issue tracker (the seat issue-tracker'slist); nothing is read from a description.
A merge the forge account cannot carry out is not asked (issue 1945)
Before the operator's Approve is asked, the gate reads through gitea_commit_statuses whether the forge's merging
account writes each repository the ask covers (merge.writes). Where it does not, nothing is asked: the delivery waits
on "the forge account cannot write : gitea_grant_write" (show), raised at once as a condition. The read holds
until the gitea module's gitea.repo.writable (its grant, read back) or ten minutes, then the ask is made again; an
approved merge of that repository the forge refused is asked again on the same event (writes.go).
The seat's hand-over
The gate took the seat mesh-delivery over from the module mesh-delivery (ADR 0449 §4, ADR 0450 §6, ADR 0454) and carried its
deliveries, groups and pull keys once; the carry, and the reading of the controller's assignments and the node-engine's have keys
that waited for it, went with release 6. catalogue_test.go keeps the catalogue to one claimant of the seat.