Fixes issue 721 note 11 (main.459 failed on TestSelfcompose/TheNodeComposesItsWantsFromTheBus, the third time: the test ran compose by hand beside the composer's own loop).
compose and composeEarly hold an unexported lock passMu for the whole pass, so no second pass runs beside the loop (lock order passMu then c.mu; only the loop calls them in production).
The issue 1966 step makes its hand passes on a loopless scratch copy.
A test checks a hand pass cannot begin while the loop's pass runs (passMu.TryLock, no wall time); 721/AC2.
The kind 'a test waits a fixed quiet window' (issue 721 notes 14, 16): the shadow part runs in a testing/synctest bubble; the pattern bus fixture's watch ends with its context. Left by choice: the composer part's quiet() windows (no sync point until the fake bus changes; issue 721 note 16).
Quick or thorough: quick = change the test; thorough (chosen) = the lock, so two passes can never overlap.
Proof: -race -count=200 TestSelfcompose passed; 240/240 under load (48 procs x 5, GOMAXPROCS=2, -race), trunk 6/48 processes failed; unit suite, both vets, embedded-bus integration tests of selfcompose, link and cmd/mesh-host.
Bent rule (rules-are-weighed): issue 721 note 15 (What exists today, Acceptance criteria) came after the first commit fd7f049e; the search matches (reviewer, rounds 1 and 2).
Merged at once, without waiting for the pull request's check, by the operator's temporary rule until design 47 is delivered.
Reviewed-by: mesh-code-reviewer@shanks for lead-47@shanks at e4926f706e
Fixes issue 721 note 11 (main.459 failed on TestSelfcompose/TheNodeComposesItsWantsFromTheBus, the third time: the test ran compose by hand beside the composer's own loop).
- `compose` and `composeEarly` hold an unexported lock `passMu` for the whole pass, so no second pass runs beside the loop (lock order passMu then c.mu; only the loop calls them in production).
- The issue 1966 step makes its hand passes on a loopless scratch copy.
- A test checks a hand pass cannot begin while the loop's pass runs (passMu.TryLock, no wall time); 721/AC2.
- The kind 'a test waits a fixed quiet window' (issue 721 notes 14, 16): the shadow part runs in a testing/synctest bubble; the pattern bus fixture's watch ends with its context. Left by choice: the composer part's quiet() windows (no sync point until the fake bus changes; issue 721 note 16).
Quick or thorough: quick = change the test; thorough (chosen) = the lock, so two passes can never overlap.
Proof: -race -count=200 TestSelfcompose passed; 240/240 under load (48 procs x 5, GOMAXPROCS=2, -race), trunk 6/48 processes failed; unit suite, both vets, embedded-bus integration tests of selfcompose, link and cmd/mesh-host.
Bent rule (rules-are-weighed): issue 721 note 15 (What exists today, Acceptance criteria) came after the first commit fd7f049e; the search matches (reviewer, rounds 1 and 2).
Merged at once, without waiting for the pull request's check, by the operator's temporary rule until design 47 is delivered.
Reviewed-by: mesh-code-reviewer@shanks for lead-47@shanks at e4926f706e21a65d4b35c6a752ddcf61815c8ee6
TestSelfcompose/TheNodeComposesItsWantsFromTheBus failed pipelines main.266,
main.459 and main.479: its issue 1966 step composed by hand beside the
composer's running loop, and a loop pass woken by an entry's answer composed
tool too and handed it on out, so a later quiet or wait saw n1.tool.
The kind is two passes over one composer's state at once. compose and
composeEarly now hold one lock (passMu) for the whole pass, so a pass asked
while another runs is made after it. The lock alone does not take the
order away (the loop's woken pass may still come before the test's), so the
step's passes run on a copy of what the composer holds (scratch), which runs
no loop; the take-back pass at its end is no longer needed and goes.
The test of an ask while a pass runs also makes a pass by hand there: it
does not begin until the running one ended (fails without the lock). Its
read of what runs no longer blocks once eight reads are unheard (a pass
reads it more than once, and the extra pass filled the channel).
Issue 721 note 11 (a blocking fault for its live proof).
Review round 1 of fd7f049e. The test of an ask while a pass runs waited a
fixed 50 ms for a pass made by hand not to begin. It now checks, while the
loop's pass is held, that the lock of a whole pass is taken (TryLock is
false), which needs no wall time and fails at once when compose takes no
lock; the pass made by hand must still end once the held pass did. Both
tests of the fix cite their criterion, 721/AC2.
Issue 721 (note 15, acceptance criterion 721/AC2).
Review round 1 of fd7f049e, the kind "a test waits a fixed quiet window"
(the 50 ms window of the hand pass was the first, note 14's shadow part the
second). The shadow part of TheNodeComposesItsWantsFromTheBus counted its
answers after fixed windows (150 ms drains, a 100 ms no-answer window, two
30 ms sleeps) and failed under load on trunk too (2 of 48 processes).
It now runs in a bubble of testing/synctest: each of those waits ends only
once every goroutine of the bubble is idle and the bubble's clock passed
it, so a slow build node cannot end it early. The pattern bus's watch ends
with its context, as the bus's own does, so the bubble's readers end with
it. What the steps after the shadow use (the record, the assignment, the
want) is made before the bubble; the shadow ends inside it.
Under load (48 processes x 5, GOMAXPROCS=2, race detector): 240 of 240
passed (trunk: 6 of 48 processes failed).
Issue 721 (note 15, acceptance criterion 721/AC2).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes issue 721 note 11 (main.459 failed on TestSelfcompose/TheNodeComposesItsWantsFromTheBus, the third time: the test ran compose by hand beside the composer's own loop).
composeandcomposeEarlyhold an unexported lockpassMufor the whole pass, so no second pass runs beside the loop (lock order passMu then c.mu; only the loop calls them in production).Quick or thorough: quick = change the test; thorough (chosen) = the lock, so two passes can never overlap.
Proof: -race -count=200 TestSelfcompose passed; 240/240 under load (48 procs x 5, GOMAXPROCS=2, -race), trunk 6/48 processes failed; unit suite, both vets, embedded-bus integration tests of selfcompose, link and cmd/mesh-host.
Bent rule (rules-are-weighed): issue 721 note 15 (What exists today, Acceptance criteria) came after the first commit fd7f049e; the search matches (reviewer, rounds 1 and 2).
Merged at once, without waiting for the pull request's check, by the operator's temporary rule until design 47 is delivered.
Reviewed-by: mesh-code-reviewer@shanks for lead-47@shanks at
e4926f706e