runs/drivers: a run driven again after a restart cuts an open test check's shards anew: running shards run on for nobody, ended ones are run again, and a check with two failed shards was told pass #86

Open
opened 2026-11-16 07:10:21 +00:00 by xemmerling · 0 comments
Owner

Found at the 06:52Z promote of bcf50c33 (old server stopping from 06:52:02Z), by counting CI checks of one run that still had a job from before the restart running when a job of the same check started after it. Nothing changed by me. The same count at tonight's other restarts: 52 at 03:19Z, 0 at 04:56Z and 05:55Z, 3 here.

What happened

From t.job_history and t.jobs, jobs of the check on either side of the restart:

run check jobs before pass / fail CPU min jobs after pass / fail CPU min told
rb8fad7f7ea (head 56849) test/tilo-session-client 8 6 / 2 35 9 9 / 0 18 pass at 07:04:54Z, no failed test
red733d75f1 test/tilo-session 45 43 / 2 127 22 20 / 2 118 fail, 3 failed tests
red733d75f1 test/tilo-session-client see below pass at 07:10Z

The third check at 07:10Z, ended jobs by side (side, jobs, pass, fail, CPU min, first start, last end) and jobs still in t.jobs:

before | 10 | 8 | 2 | 18 | 06:47:51 | 07:07:47
after | 9 | 9 | 0 | 19 | 06:54:04 | 07:07:46

Three things are in it.

  1. The shards that were running run on for nobody. j584-2074 and j584-2078 (rb8fad7f7ea, started 06:37:06Z, one thread each) ran until 07:05:49Z and 07:05:40Z: thirteen minutes after the restart, and 45 s after their check had been told. The new server logged only an end taken in job=j584-2078 … for each.
  2. The ended shards' work is done again. The jobs after the restart ran for real, 136 CPU minutes for the first two checks, though most of the shards before it had passed. The numbers of jobs differ (8 and 9, 45 and 22): they are other shards, so nothing the first drive answered could answer them.
  3. A verdict changed. rb8fad7f7ea's check had two failed shards before the restart (j584-2076 at 06:39:24Z, j584-2071 at 06:40:00Z) and was told pass after it, on the second cut's nine jobs.

Reading of the code (origin/main)

  • The new server: a run driven again keeps the checks it told run=rb8fad7f7ea kept=1290 of=1291. The one check left untold is driven from its start (docs/spec.md:1776, "drives only the checks it left untold").
  • src/drivers/cargo/mod.rs:1483-1507: a binary's cut is made at drive time from test_times and fixed_costs as the database holds them then. The first drive's ended shards had written new times and fixed costs, and a failed test's time is never counted, so the second drive cuts another way.
  • The same lines handle the neighbouring case: shards a stopped run left under its claim are asked for again as those same shards and taken over (taking_left, Jobs::take_left). A run's own shards that a restarted server found open get no such ask, so Jobs::resume (docs/spec.md:842-844, "the one way a restarted server's run follows a job it found open") is never reached for them. I have not traced where such a followed job is held until its end.

A possible shape

A check's cut is made once for a run: kept with the run when it is first made, or rebuilt from the shards still out as taking_left does. A run driven again then asks for the same shards: the running ones are followed, and the ended ones are answered from what the first drive kept, or run again as the same shards. Which of these, and whether a failed shard's failure should survive the restart, is a design choice I would like your word on before anything is built. Tonight had seven restarts, and every test check open at one of them pays this.

Again at the next restart (07:56Z, the promote of b5c5b140)

The same count, three checks in two head runs; ended jobs by side of the restart:

run check jobs before pass / fail CPU min jobs after pass / fail CPU min told
r912cdd092e (head 56888) test-x86_64/tilo-agent-participant 11 7 / 4 19 9 7 / 2 19 fail, 2 failed tests
rb0dc274826 (head 56895) test-x86_64/tilolang-tilo 13 13 / 0 12 15 15 / 0 16 pass
rb0dc274826 test-x86_64/tilo-agent-participant 1 1 / 0 1 9 6 / 3 19 fail, 3 failed tests
  • tilolang-tilo is the plain case: thirteen shards, every one passed (the last at 07:57:16Z, 36 s after the restart), and fifteen other shards run from 07:57:11Z for 16 CPU minutes to say the same.
  • r912cdd092e's check had four failed shards before the restart and is told with the failed tests of two.
  • The new server logged a run driven again keeps the checks it told for 22 runs; these two kept 1,290 of 1,291 and 1,282 of 1,291.

So it happens at every restart with a test check open, and it is not a matter of load. I am having the code read for the smallest change that makes a run driven again ask for the shards its first drive cut, and will put the proposal here before anything is built.

What the code does, and a proposal (read 08:20Z on 95b08710; nothing built)

Read, not run:

  1. Nothing matches a run's found shards to its new asks. run() resumes every Followed as a task of its own (src/runs/run.rs:949-980), seeding the flight with the job's own key, which for a shard is its shard key (Carried::keys, src/jobs/carried.rs:61-72). The run driven again settles the binary's run key, which nobody seeded, gets Own, cuts again (src/drivers/cargo/mod.rs:1506-1525) and asks each shard through Jobs::run and take_left, which looks only at s.left (src/jobs/follow.rs:198-210). A found job is never there. A binary that ran whole is different: its action key is the run key, so the drive joins it. Only cuts into several shards break.
  2. The test list is in a shard's key (keys::shard_key, src/jobs/keys.rs:352-354), so another cut is other keys.
  3. A shard's answer is kept nowhere. The cache keeps only the binary's combined result once every shard has ended (src/drivers/actions.rs:167, mod.rs:1771-1792); a shard's row is deleted as it is concluded (run.rs:2979-2981); until the binary is recorded the shards' results live only in run_shards' local ended (mod.rs:1740-1751). So a restart forgets every ended shard, failed ones too, and the first drive's ends have meanwhile rewritten test_samples and fixed_costs, the next cut's inputs (failed tests become shards of their own, shards.rs:43-52).
  4. The found shard runs on and is concluded for nobody: its "resumed job" task follows it to its end, deletes its row and hands the result to an owner no one waits on.
  5. Two sentences of docs/spec.md describe this as not happening: 864-875 says of left shards that cutting afresh would make keys "others than the left ones', which would run on for nobody", and 1798-1802 says a failing family's shards each conclude what they computed "so that the drive again finds those answers". The first holds for a stopped run's shards only; the second holds for no shard.

Proposal, in two parts.

A. A run's found shards are its cut, as a stopped run's left shards are. In run() the Followed with carries.part_of() set are set aside by that key instead of resumed at once; shards_of builds the cut from their Run { tests } with taking_left's own logic (tests in no found shard are cut afresh), and run_shards resumes the found job for a shard whose key matches instead of asking a new one. Everything it needs is in the rows today. Points to watch: the binary's run key is not held across the gap (adopted_by holds a.key, not a.claim()), so another run of the trust could claim the binary first; found shards that match nothing (another archive, a check already told) must still be resumed or given up; a test with several shards open across a takeover does not exist yet (a_stopped_runs_shards_pass_together_to_the_run_waiting_on_their_binary, src/drivers/cargo/tests.rs:3131, with h.reopen(2) in place of the stop is the template).

B. A shard's row stays until its binary is recorded. Then an ended shard comes back at a takeover as an end left behind and A replays it: no rerun, and a failed shard stays failed. This is the part that carries most of what production showed (most shards had ended before each restart), and it is the part that changes things you set down: the jobs table's rule ("deleted in the transaction that records its results"), cleanup at a stop, and what a takeover reads (restore_tests.rs:419 checks that it reads no ends).

A alone stops the shards running side by side; A with B stops the work being done again and keeps the failures. Reusing take_left by putting found shards into s.left looks smaller and is not safe (a handed row is never resent; dropping the Followed gives the job up).

I would build A and B together on a branch, with the shard test above and a production-size take-over run, and not land B without your word, since it is your table and your restore path. If you are already on this, say so and I leave it.

Again at the 03:29Z restart on 11-17 (the promote of a98a041d), and what I am building

Head run rd9c95fa2a9 (asked 02:26:38Z) had told 1,290 of its 1,291 checks and stood on test/tilo-session alone.

jobs of the check asked what they did
first drive 42 02:51:52Z 35 passed, 7 failed; all but one ended by 03:04:58Z
the one still running j594-14562 02:51:52Z started 02:56:36Z, ran 36.1 min across the restart, ended fail at 03:32:44Z, for nobody
drive again 31 so far 03:30:01Z the new server: a run driven again keeps the checks it told run=rd9c95fa2a9 kept=1290 of=1291; 27 passed, 4 failed; the long shard was asked again as j595-286 and started from nothing at 03:33:36Z

The head's last answer was three minutes from done at the restart and would have told it at 03:32:44Z, 66 minutes after its ask. It is still open at 03:47Z, 81 minutes, with the long shard about 36 minutes from its second end. At that start the server drove 21 runs again with 2,365 open checks between them, and asked 396 test/* and 148 test-x86_64/* CI jobs in the first 90 seconds.

My own after-restart count (a job of a check from before the restart still running when a job of the same check starts after it) read 0 here: the long shard ended 49 seconds before the new shards started, in line behind the wave. So the count undercounts; the jobs' history shows it.

There have been three restarts in waves tonight (23:29Z, 00:59Z, 03:29Z), and this issue has had no answer in 19 hours, so I am deciding from the data, as I said I would: I am building part A now (a run's found shards are its cut and are followed, as a stopped run's left shards are), on a branch, with the several-shards-open take-over test and the production-size take-over run, and will land it when both pass. It touches neither the jobs table's rule nor what a takeover reads. Part B stays unbuilt until you say (a shard's row kept until its binary is recorded): your table, your restore path. With A alone this head would have been told at about 03:37Z: the long shard followed to its end, the thirty ended two-minute shards run again. If you are on this already or want another shape, say so here and I stop.

04:30Z 11-17: part A is written and not ready

Branch dev/found-shards-are-the-cut, commit e61b411d (runs/run.rs, drivers/mod.rs, drivers/cargo/mod.rs, jobs/follow.rs, three tests, docs/spec.md; no schema, protocol, scheduler or key change). A run driven again sets each found shard of a check it still drives aside under its binary's run key, claims that key again before the shard's hold in Adopting goes, cuts the binary with taking_left from the found shards, and follows the found job where the cut asks for the same shard. A followed shard now holds its binary's run key in Adopting (Carried::claim), not its own key.

On t-testing:

result
the three new tests on main with only the tests added (run rd5bcce19b8) all three fail; the first with "no job asked again for the tests of the shard found open"
the same on e61b411d (run r50d28b4129) two pass; a_shard_found_open_that_the_cut_takes_none_of_is_followed_for_nobody times out at 180 s, no output
whole check set, e61b411d on a98a041d (run re59f225bea) green but for that test
two_hundred_and_fifty_tilo_sized_runs_resumed_at_a_takeover on e61b411d (run r06c0090bc8, t cargo on testing) pass: the takeover led in 17.6 s, peak memory 0 MiB above the takeover's 6,062 MiB, 250,250 checks told, none twice

The timeout is the case of a found shard the new cut takes none of, which is where a hang would be a head that never ends, so nothing lands. It is back with the developer: is it the code waiting where it must not (the check's task awaits the stray job), or the test. The production-size test has no run with several shards open, so its pass says only that the old path is unharmed at size.

05:50Z 11-17: part A is on main, 8e5df150 (not promoted)

The timeout was the test's, not the code's. The test records an aarch64 node before the restart so that the run's key changes and the found shard matches nothing; its arch=any family then also asks for an aarch64 unit graph, and the test had started a resolver for x86_64 alone. Whenever the aarch64 node polled first, the drive waited for a resolver before it cut anything and the check stood queued ("a unit graph waits for a resolver arch=aarch64 resolvers=0"). Reproduced locally: 3 hangs in 15 runs before, none in 30 runs and a 20-iteration stress run after. The test now answers that graph, and the found-shard tests' waits give up after two minutes saying what they waited for.

Two commits on your 74c7c3d3: 0abd8ed3 (the change as described above) and 8e5df150 (the test's fix, two more tests; its only change outside tests is adopted_keys pulled out of Followed::adopted_by, same behaviour). No schema, protocol, key, scheduler or admission change.

On t-testing:

result
the five found-shard tests on the final commits (run r5869583163) 5 pass
whole check set, both commits on 74c7c3d3 (run r4244d8b0c3) 8 passed, 0 failed
two_hundred_and_fifty_tilo_sized_runs_resumed_at_a_takeover, both commits on 08ccf2a2 (t cargo on testing; 74c7c3d3 changes test set-up only) pass: the takeover led in 17.4 s, peak memory 6,109 MiB, 0 MiB above the 6,122 MiB at the takeover, 250,250 checks told, none twice

Still shown by no test: another run settling the binary's run key in the gap between the lead and the first run's drive. another_run_asking_for_a_binary_whose_shards_were_found_open_joins_their_run passes on main too, because its asks come after that drive started. The claim is seeded before the shard's hold in Adopting goes, which is what closes the gap by construction; a test that forces the interleaving is owed.

It acts at a restart. After the first one on a build with it I read t.job_history by run and check for the open test checks: shards asked again for tests a found shard was already running should be gone. Part B (a shard's rows kept until its binary is recorded) is not built and waits for your word.

06:31Z 11-17: seen on real restarts

where what was open after the restart
testing, f9cb88e3, server pod deleted 06:31:46Z (run rfbf9191bc7) 15 of the binary's 16 shards running, 983 tests in them "a test binary's shards found open are its cut … shards=16", each of the 15 followed; no new shard job for their tests, 0 of 983 tests asked again; one job asked after the restart, for the shard that had ended before it (part B's case); pass in 85 s
testing, the same proof at 06:25Z, taken over by a98a041d (your upgrade proof had put it there; run r1b69ab706f) 14 shards running, 1,011 tests the fault as filed: 17 new shard jobs, all 1,011 tests asked again, 11 found shards ran on for nobody, 3 ended cache_unreachable
production, your promote of f9cb88e3 at 06:30:31Z 82 jobs re-attached shards found open were the cut for test/chat (8 followed) and test/tilo-session-client (4 followed, two binaries' cuts)

Production's count is small because 34 of the 40 open heads ended at that start for another reason (issue 95, the left_along read). Two of the jobs given up there were test/tilo-session-client shards set aside for a run whose drive then failed: the guard gave them up, as it does for any followed job whose run's drive ends in an error.

Part A does what it says on a real server. Part B is the one job in the first row: a shard that ended before the restart is asked again while its binary is not recorded.

11-17, part B's size at each of today's five starts (this replaces my 12:24Z paragraph, which counted only jobs started in the first three minutes and so undercounted). For every test binary whose shards the new server found open, from its log ("shards found open are its cut", "a shard found open is followed") and t.job_history:

start build run, check shards ended before / open at the restart followed jobs started again their running time
09:43Z c6a21463 rf08b17cbd9 test-x86_64/tilo-agent-session 2 / 1 1 1 72 s
09:43Z c6a21463 re66e214a43 test/chat 0 / 13 13 0
10:16Z f9cb88e3 r965a72d095 test/chat 11 / 4 4 9 470 s
11:21Z eae869f7 none found open 0
12:06Z 8986e664 r1d0b179470 test/tilo-session-client 18 / 2 2 14 969 s
12:06Z 8986e664 r0e4a6a2c44 test-x86_64/tilo-agent-session 5 / 1 1 4 77 s
12:06Z 8986e664 r4d6bf77055 test-x86_64/tilo-agent-session 1 / 7 7 0
12:06Z 8986e664 r26d73216f9 test-x86_64/tilo-agent-participant 22 / 14 14 18 1,364 s
12:06Z 8986e664 rf14617aac9 test/tilo-session 30 / 20 20 10 617 s
12:42Z 2868c3f2 r41a5e3c9b3 test-x86_64/tilo-agent-session 21 / 16 16 24 743 s

Part A held at every start: each shard found open was followed and none of its tests was asked again (79 shards followed in all). Part B's case, shards that had ended before the restart and are run again because their binary was not yet recorded: 80 jobs and 72 minutes of running over the five starts, 46 jobs and 50 minutes at my 12:06Z promote alone. Where a re-run shard had failed before it failed again (r1d0b179470, r41a5e3c9b3), so no verdict changed today. A binary all of whose shards had ended, with none open, leaves no log line and is not in this table, so the true figure is at least this.

14:35Z 11-17 (production f5147065, your promote): the sixth start, and a tighter way to count. One head, rc96a909826, had eight test binaries with open shards. Per check, from t.job_history:

check jobs ended before the restart / still running at it followed jobs started in the 12 min after of them at most re-runs their running time
test/tilo-session 6 / 7 7 32 6 4,533 s
test/tilo-session-client 15 / 1 3 12 12 819 s
test/tilo-runtime 5 / 1 1 6 5 297 s
test/sheets 4 / 1 1 5 4 157 s
test/tilo-fs 6 / 4 4 2 2 98 s
test/tilolang-app 2 / 12 12 2 2 52 s
test/chat 1 / 8 8 0 0
test/video-editor 19 / 8 8 0 0

A job started after the restart is a re-run only if its shard had ended before; a shard of the cut that had not started yet is run for the first time. So the count of re-runs is at most the smaller of "ended before" and "started after": 31 jobs here, not the 59 started. By the same rule the 12:42Z row above is at most 21 re-runs, not 24 (37 of that cut's 40 shards had started before the restart); the other rows stand. Today's six starts then re-ran at most 108 ended shards. The start itself was clean: no run ended, no statement cancelled, 79 jobs re-attached, no job ended as an error by 14:51Z.

18:30Z 11-17 (production 2885a521, your promote): the seventh start. The start ended no run and erred no job. Seven CI checks had jobs on both sides of it; per check, from t.job_history, counted as at 14:35Z:

run, check jobs ended before the restart / still running at it jobs started in the 11 min after of them at most re-runs
r02d57fe3d6 test/tilo-session 52 / 5 54 52
r02d57fe3d6 test/tilo-session-client 18 / 2 16 16
r2b5d510336 test-x86_64/tilo-agent-session 10 / 26 10 10
r5e6d682621 test/tilo-session-client 9 / 2 14 9
three more checks 1 / 4 4 1

At most 88 ended shards were run again at this start, the most of the day's seven (at most 196 in all). Part A held again: 39 jobs were running at the start and none of them erred.

23:32Z 11-17 (production 7710cc0d, your promote): the eighth start. The start ended no run with an error and erred no job; the worker re-attached 117 jobs. Thirty CI and probe checks in nine runs had jobs on both sides of it; from t.job_history, counted at 00:05Z, 33 minutes after:

check (runs) jobs ended before the restart jobs started after of them at most re-runs
test/tilo-workspace-host (2) 18 17 17
test/video-editor (1) 7 16 7
test/tilo-session (1) 4 33 4
test/word-processor (1) 7 3 3
test-x86_64/tilo-agent-session (1) 34 2 2
test/notes (1) 34 2 2
test/tasks (1) 8 2 2
test/tilo-action-broker (1) 3 2 2
all 30 checks 142, and 49 running at it 154 63

At most 63 ended shards were run again at this start (per check the smaller of the two counts, summed), which makes at most 259 over the day's eight starts. The window is longer than the 11 minutes of the row above, so more of the 154 are first runs. Part A held again: 49 jobs were running at the start and none erred.

01:21Z 11-18 (production ab189001, your promote): the ninth start. Counted at 01:52Z, half an hour after: one check in one run had jobs on both sides of it (test/tilo-cli: 1 job ended before the restart, none running at it, 2 started after), so at most 1 ended shard was run again, the fewest of any start read here; no check was given a second job while its first still ran. Part A held for 54 of the 55 jobs that ran across it; the one that erred is not this fault but the crate refusal across the worker's upgrade (#63, j605-532).

03:29Z 11-18 (production 7d7c6593, your promote): the tenth start. Counted at 04:00Z, half an hour after: five checks in three runs had jobs on both sides of it.

check (runs) jobs ended before the restart jobs started after of them at most re-runs
test-idle/tilo-ui (1) 35 34 34
test-x86_64/tilo-agent-session (1) 19 25 19
test-x86_64/tilolang-cli (1) 14 16 14
test/tilo-server (1) 10 62 10
test/tilo-session (1) 1 45 1
all five 79, and 7 running at it 182 78

At most 78 ended shards were run again. No check was given a second job while its first still ran. No job erred across the restart for this; the five that erred around it are the set-up stall of #84.

05:05:22Z 11-18, the start of 85866e52 (read 05:36Z, same statement): 3 pairs of a run and a check of class ci or probe had a job ended before the start and one started after it, re-runs at most 22. The rows so far: 18:30Z at most 88, 23:32Z at most 63, 01:21Z at most 1, 03:29Z at most 78, 05:05Z at most 22. No check of a run was given a second job beside a first that still ran. 12 heads were asked in the half hour after and 9 judged.

07:32:33Z and 08:17:41Z 11-18, the starts of 06f61244 and d748ed8d (same statement, each read half an hour after): 07:32Z: 0 pairs, 0 re-runs, the first restart with none. 08:17Z: 1 pair, at most 1 re-run. The rows so far: 18:30Z at most 88, 23:32Z at most 63, 01:21Z at most 1, 03:29Z at most 78, 05:05Z at most 22, 07:32Z 0, 08:17Z at most 1. At neither start was a check of a run given a second job beside a first that still ran. The 08:17Z start came during a stop of head runs (issue 102), so few CI jobs ran across it.

Found at the 06:52Z promote of bcf50c33 (old server stopping from 06:52:02Z), by counting CI checks of one run that still had a job from before the restart running when a job of the same check started after it. Nothing changed by me. The same count at tonight's other restarts: 52 at 03:19Z, 0 at 04:56Z and 05:55Z, 3 here. ## What happened From `t.job_history` and `t.jobs`, jobs of the check on either side of the restart: | run | check | jobs before | pass / fail | CPU min | jobs after | pass / fail | CPU min | told | |---|---|---|---|---|---|---|---|---| | rb8fad7f7ea (head 56849) | test/tilo-session-client | 8 | 6 / 2 | 35 | 9 | 9 / 0 | 18 | pass at 07:04:54Z, no failed test | | red733d75f1 | test/tilo-session | 45 | 43 / 2 | 127 | 22 | 20 / 2 | 118 | fail, 3 failed tests | | red733d75f1 | test/tilo-session-client | see below | | | | | | pass at 07:10Z | The third check at 07:10Z, ended jobs by side (side, jobs, pass, fail, CPU min, first start, last end) and jobs still in `t.jobs`: ``` before | 10 | 8 | 2 | 18 | 06:47:51 | 07:07:47 after | 9 | 9 | 0 | 19 | 06:54:04 | 07:07:46 ``` Three things are in it. 1. **The shards that were running run on for nobody.** j584-2074 and j584-2078 (rb8fad7f7ea, started 06:37:06Z, one thread each) ran until 07:05:49Z and 07:05:40Z: thirteen minutes after the restart, and 45 s after their check had been told. The new server logged only `an end taken in job=j584-2078 …` for each. 2. **The ended shards' work is done again.** The jobs after the restart ran for real, 136 CPU minutes for the first two checks, though most of the shards before it had passed. The numbers of jobs differ (8 and 9, 45 and 22): they are other shards, so nothing the first drive answered could answer them. 3. **A verdict changed.** rb8fad7f7ea's check had two failed shards before the restart (j584-2076 at 06:39:24Z, j584-2071 at 06:40:00Z) and was told `pass` after it, on the second cut's nine jobs. ## Reading of the code (origin/main) - The new server: `a run driven again keeps the checks it told run=rb8fad7f7ea kept=1290 of=1291`. The one check left untold is driven from its start (docs/spec.md:1776, "drives only the checks it left untold"). - `src/drivers/cargo/mod.rs:1483-1507`: a binary's cut is made at drive time from `test_times` and `fixed_costs` as the database holds them then. The first drive's ended shards had written new times and fixed costs, and a failed test's time is never counted, so the second drive cuts another way. - The same lines handle the neighbouring case: shards a stopped run left under its claim are asked for again as those same shards and taken over (`taking_left`, `Jobs::take_left`). A run's own shards that a restarted server found open get no such ask, so `Jobs::resume` (docs/spec.md:842-844, "the one way a restarted server's run follows a job it found open") is never reached for them. I have not traced where such a followed job is held until its end. ## A possible shape A check's cut is made once for a run: kept with the run when it is first made, or rebuilt from the shards still out as `taking_left` does. A run driven again then asks for the same shards: the running ones are followed, and the ended ones are answered from what the first drive kept, or run again as the same shards. Which of these, and whether a failed shard's failure should survive the restart, is a design choice I would like your word on before anything is built. Tonight had seven restarts, and every test check open at one of them pays this. ## Again at the next restart (07:56Z, the promote of b5c5b140) The same count, three checks in two head runs; ended jobs by side of the restart: | run | check | jobs before | pass / fail | CPU min | jobs after | pass / fail | CPU min | told | |---|---|---|---|---|---|---|---|---| | r912cdd092e (head 56888) | test-x86_64/tilo-agent-participant | 11 | 7 / 4 | 19 | 9 | 7 / 2 | 19 | fail, 2 failed tests | | rb0dc274826 (head 56895) | test-x86_64/tilolang-tilo | 13 | 13 / 0 | 12 | 15 | 15 / 0 | 16 | pass | | rb0dc274826 | test-x86_64/tilo-agent-participant | 1 | 1 / 0 | 1 | 9 | 6 / 3 | 19 | fail, 3 failed tests | - `tilolang-tilo` is the plain case: thirteen shards, every one passed (the last at 07:57:16Z, 36 s after the restart), and fifteen other shards run from 07:57:11Z for 16 CPU minutes to say the same. - r912cdd092e's check had four failed shards before the restart and is told with the failed tests of two. - The new server logged `a run driven again keeps the checks it told` for 22 runs; these two kept 1,290 of 1,291 and 1,282 of 1,291. So it happens at every restart with a test check open, and it is not a matter of load. I am having the code read for the smallest change that makes a run driven again ask for the shards its first drive cut, and will put the proposal here before anything is built. ## What the code does, and a proposal (read 08:20Z on 95b08710; nothing built) Read, not run: 1. **Nothing matches a run's found shards to its new asks.** `run()` resumes every `Followed` as a task of its own (`src/runs/run.rs:949-980`), seeding the flight with the job's own key, which for a shard is its shard key (`Carried::keys`, `src/jobs/carried.rs:61-72`). The run driven again settles the binary's run key, which nobody seeded, gets `Own`, cuts again (`src/drivers/cargo/mod.rs:1506-1525`) and asks each shard through `Jobs::run` and `take_left`, which looks only at `s.left` (`src/jobs/follow.rs:198-210`). A found job is never there. A binary that ran whole is different: its action key is the run key, so the drive joins it. Only cuts into several shards break. 2. **The test list is in a shard's key** (`keys::shard_key`, `src/jobs/keys.rs:352-354`), so another cut is other keys. 3. **A shard's answer is kept nowhere.** The cache keeps only the binary's combined result once every shard has ended (`src/drivers/actions.rs:167`, `mod.rs:1771-1792`); a shard's row is deleted as it is concluded (`run.rs:2979-2981`); until the binary is recorded the shards' results live only in `run_shards`' local `ended` (`mod.rs:1740-1751`). So a restart forgets every ended shard, failed ones too, and the first drive's ends have meanwhile rewritten `test_samples` and `fixed_costs`, the next cut's inputs (failed tests become shards of their own, `shards.rs:43-52`). 4. **The found shard runs on and is concluded for nobody**: its "resumed job" task follows it to its end, deletes its row and hands the result to an owner no one waits on. 5. Two sentences of `docs/spec.md` describe this as not happening: 864-875 says of left shards that cutting afresh would make keys "others than the left ones', which would run on for nobody", and 1798-1802 says a failing family's shards each conclude what they computed "so that the drive again finds those answers". The first holds for a stopped run's shards only; the second holds for no shard. Proposal, in two parts. **A. A run's found shards are its cut, as a stopped run's left shards are.** In `run()` the `Followed` with `carries.part_of()` set are set aside by that key instead of resumed at once; `shards_of` builds the cut from their `Run { tests }` with `taking_left`'s own logic (tests in no found shard are cut afresh), and `run_shards` resumes the found job for a shard whose key matches instead of asking a new one. Everything it needs is in the rows today. Points to watch: the binary's run key is not held across the gap (`adopted_by` holds `a.key`, not `a.claim()`), so another run of the trust could claim the binary first; found shards that match nothing (another archive, a check already told) must still be resumed or given up; a test with several shards open across a takeover does not exist yet (`a_stopped_runs_shards_pass_together_to_the_run_waiting_on_their_binary`, `src/drivers/cargo/tests.rs:3131`, with `h.reopen(2)` in place of the stop is the template). **B. A shard's row stays until its binary is recorded.** Then an ended shard comes back at a takeover as an end left behind and A replays it: no rerun, and a failed shard stays failed. This is the part that carries most of what production showed (most shards had ended before each restart), and it is the part that changes things you set down: the `jobs` table's rule ("deleted in the transaction that records its results"), cleanup at a stop, and what a takeover reads (`restore_tests.rs:419` checks that it reads no ends). A alone stops the shards running side by side; A with B stops the work being done again and keeps the failures. Reusing `take_left` by putting found shards into `s.left` looks smaller and is not safe (a handed row is never resent; dropping the `Followed` gives the job up). I would build A and B together on a branch, with the shard test above and a production-size take-over run, and not land B without your word, since it is your table and your restore path. If you are already on this, say so and I leave it. ## Again at the 03:29Z restart on 11-17 (the promote of a98a041d), and what I am building Head run rd9c95fa2a9 (asked 02:26:38Z) had told 1,290 of its 1,291 checks and stood on `test/tilo-session` alone. | | jobs of the check | asked | what they did | |---|---|---|---| | first drive | 42 | 02:51:52Z | 35 passed, 7 failed; all but one ended by 03:04:58Z | | the one still running | j594-14562 | 02:51:52Z | started 02:56:36Z, ran 36.1 min across the restart, ended `fail` at 03:32:44Z, for nobody | | drive again | 31 so far | 03:30:01Z | the new server: `a run driven again keeps the checks it told run=rd9c95fa2a9 kept=1290 of=1291`; 27 passed, 4 failed; the long shard was asked again as j595-286 and started from nothing at 03:33:36Z | The head's last answer was three minutes from done at the restart and would have told it at 03:32:44Z, 66 minutes after its ask. It is still open at 03:47Z, 81 minutes, with the long shard about 36 minutes from its second end. At that start the server drove 21 runs again with 2,365 open checks between them, and asked 396 `test/*` and 148 `test-x86_64/*` CI jobs in the first 90 seconds. My own after-restart count (a job of a check from before the restart still running when a job of the same check starts after it) read 0 here: the long shard ended 49 seconds before the new shards started, in line behind the wave. So the count undercounts; the jobs' history shows it. There have been three restarts in waves tonight (23:29Z, 00:59Z, 03:29Z), and this issue has had no answer in 19 hours, so I am deciding from the data, as I said I would: **I am building part A now** (a run's found shards are its cut and are followed, as a stopped run's left shards are), on a branch, with the several-shards-open take-over test and the production-size take-over run, and will land it when both pass. It touches neither the `jobs` table's rule nor what a takeover reads. **Part B stays unbuilt until you say** (a shard's row kept until its binary is recorded): your table, your restore path. With A alone this head would have been told at about 03:37Z: the long shard followed to its end, the thirty ended two-minute shards run again. If you are on this already or want another shape, say so here and I stop. **04:30Z 11-17: part A is written and not ready** Branch `dev/found-shards-are-the-cut`, commit e61b411d (runs/run.rs, drivers/mod.rs, drivers/cargo/mod.rs, jobs/follow.rs, three tests, docs/spec.md; no schema, protocol, scheduler or key change). A run driven again sets each found shard of a check it still drives aside under its binary's run key, claims that key again before the shard's hold in `Adopting` goes, cuts the binary with `taking_left` from the found shards, and follows the found job where the cut asks for the same shard. A followed shard now holds its binary's run key in `Adopting` (`Carried::claim`), not its own key. On t-testing: | | result | |---|---| | the three new tests on main with only the tests added (run rd5bcce19b8) | all three fail; the first with "no job asked again for the tests of the shard found open" | | the same on e61b411d (run r50d28b4129) | two pass; `a_shard_found_open_that_the_cut_takes_none_of_is_followed_for_nobody` times out at 180 s, no output | | whole check set, e61b411d on a98a041d (run re59f225bea) | green but for that test | | `two_hundred_and_fifty_tilo_sized_runs_resumed_at_a_takeover` on e61b411d (run r06c0090bc8, `t cargo` on testing) | pass: the takeover led in 17.6 s, peak memory 0 MiB above the takeover's 6,062 MiB, 250,250 checks told, none twice | The timeout is the case of a found shard the new cut takes none of, which is where a hang would be a head that never ends, so nothing lands. It is back with the developer: is it the code waiting where it must not (the check's task awaits the stray job), or the test. The production-size test has no run with several shards open, so its pass says only that the old path is unharmed at size. **05:50Z 11-17: part A is on main, 8e5df150 (not promoted)** The timeout was the test's, not the code's. The test records an aarch64 node before the restart so that the run's key changes and the found shard matches nothing; its arch=any family then also asks for an aarch64 unit graph, and the test had started a resolver for x86_64 alone. Whenever the aarch64 node polled first, the drive waited for a resolver before it cut anything and the check stood queued ("a unit graph waits for a resolver arch=aarch64 resolvers=0"). Reproduced locally: 3 hangs in 15 runs before, none in 30 runs and a 20-iteration stress run after. The test now answers that graph, and the found-shard tests' waits give up after two minutes saying what they waited for. Two commits on your 74c7c3d3: 0abd8ed3 (the change as described above) and 8e5df150 (the test's fix, two more tests; its only change outside tests is `adopted_keys` pulled out of `Followed::adopted_by`, same behaviour). No schema, protocol, key, scheduler or admission change. On t-testing: | | result | |---|---| | the five found-shard tests on the final commits (run r5869583163) | 5 pass | | whole check set, both commits on 74c7c3d3 (run r4244d8b0c3) | 8 passed, 0 failed | | `two_hundred_and_fifty_tilo_sized_runs_resumed_at_a_takeover`, both commits on 08ccf2a2 (`t cargo` on testing; 74c7c3d3 changes test set-up only) | pass: the takeover led in 17.4 s, peak memory 6,109 MiB, 0 MiB above the 6,122 MiB at the takeover, 250,250 checks told, none twice | Still shown by no test: another run settling the binary's run key in the gap between the lead and the first run's drive. `another_run_asking_for_a_binary_whose_shards_were_found_open_joins_their_run` passes on main too, because its asks come after that drive started. The claim is seeded before the shard's hold in `Adopting` goes, which is what closes the gap by construction; a test that forces the interleaving is owed. It acts at a restart. After the first one on a build with it I read `t.job_history` by run and check for the open test checks: shards asked again for tests a found shard was already running should be gone. Part B (a shard's rows kept until its binary is recorded) is not built and waits for your word. **06:31Z 11-17: seen on real restarts** | where | what was open | after the restart | |---|---|---| | testing, f9cb88e3, server pod deleted 06:31:46Z (run rfbf9191bc7) | 15 of the binary's 16 shards running, 983 tests in them | "a test binary's shards found open are its cut … shards=16", each of the 15 followed; no new shard job for their tests, 0 of 983 tests asked again; one job asked after the restart, for the shard that had ended before it (part B's case); pass in 85 s | | testing, the same proof at 06:25Z, taken over by a98a041d (your upgrade proof had put it there; run r1b69ab706f) | 14 shards running, 1,011 tests | the fault as filed: 17 new shard jobs, all 1,011 tests asked again, 11 found shards ran on for nobody, 3 ended `cache_unreachable` | | production, your promote of f9cb88e3 at 06:30:31Z | 82 jobs re-attached | shards found open were the cut for `test/chat` (8 followed) and `test/tilo-session-client` (4 followed, two binaries' cuts) | Production's count is small because 34 of the 40 open heads ended at that start for another reason (issue 95, the `left_along` read). Two of the jobs given up there were `test/tilo-session-client` shards set aside for a run whose drive then failed: the guard gave them up, as it does for any followed job whose run's drive ends in an error. Part A does what it says on a real server. Part B is the one job in the first row: a shard that ended before the restart is asked again while its binary is not recorded. **11-17, part B's size at each of today's five starts (this replaces my 12:24Z paragraph, which counted only jobs started in the first three minutes and so undercounted).** For every test binary whose shards the new server found open, from its log ("shards found open are its cut", "a shard found open is followed") and `t.job_history`: | start | build | run, check | shards ended before / open at the restart | followed | jobs started again | their running time | |---|---|---|---|---|---|---| | 09:43Z | c6a21463 | rf08b17cbd9 test-x86_64/tilo-agent-session | 2 / 1 | 1 | 1 | 72 s | | 09:43Z | c6a21463 | re66e214a43 test/chat | 0 / 13 | 13 | 0 | | | 10:16Z | f9cb88e3 | r965a72d095 test/chat | 11 / 4 | 4 | 9 | 470 s | | 11:21Z | eae869f7 | none found open | | | 0 | | | 12:06Z | 8986e664 | r1d0b179470 test/tilo-session-client | 18 / 2 | 2 | 14 | 969 s | | 12:06Z | 8986e664 | r0e4a6a2c44 test-x86_64/tilo-agent-session | 5 / 1 | 1 | 4 | 77 s | | 12:06Z | 8986e664 | r4d6bf77055 test-x86_64/tilo-agent-session | 1 / 7 | 7 | 0 | | | 12:06Z | 8986e664 | r26d73216f9 test-x86_64/tilo-agent-participant | 22 / 14 | 14 | 18 | 1,364 s | | 12:06Z | 8986e664 | rf14617aac9 test/tilo-session | 30 / 20 | 20 | 10 | 617 s | | 12:42Z | 2868c3f2 | r41a5e3c9b3 test-x86_64/tilo-agent-session | 21 / 16 | 16 | 24 | 743 s | Part A held at every start: each shard found open was followed and none of its tests was asked again (79 shards followed in all). Part B's case, shards that had ended before the restart and are run again because their binary was not yet recorded: 80 jobs and 72 minutes of running over the five starts, 46 jobs and 50 minutes at my 12:06Z promote alone. Where a re-run shard had failed before it failed again (r1d0b179470, r41a5e3c9b3), so no verdict changed today. A binary all of whose shards had ended, with none open, leaves no log line and is not in this table, so the true figure is at least this. **14:35Z 11-17 (production f5147065, your promote): the sixth start, and a tighter way to count.** One head, rc96a909826, had eight test binaries with open shards. Per check, from `t.job_history`: | check | jobs ended before the restart / still running at it | followed | jobs started in the 12 min after | of them at most re-runs | their running time | |---|---|---|---|---|---| | test/tilo-session | 6 / 7 | 7 | 32 | 6 | 4,533 s | | test/tilo-session-client | 15 / 1 | 3 | 12 | 12 | 819 s | | test/tilo-runtime | 5 / 1 | 1 | 6 | 5 | 297 s | | test/sheets | 4 / 1 | 1 | 5 | 4 | 157 s | | test/tilo-fs | 6 / 4 | 4 | 2 | 2 | 98 s | | test/tilolang-app | 2 / 12 | 12 | 2 | 2 | 52 s | | test/chat | 1 / 8 | 8 | 0 | 0 | | | test/video-editor | 19 / 8 | 8 | 0 | 0 | | A job started after the restart is a re-run only if its shard had ended before; a shard of the cut that had not started yet is run for the first time. So the count of re-runs is at most the smaller of "ended before" and "started after": 31 jobs here, not the 59 started. By the same rule the 12:42Z row above is at most 21 re-runs, not 24 (37 of that cut's 40 shards had started before the restart); the other rows stand. Today's six starts then re-ran at most 108 ended shards. The start itself was clean: no run ended, no statement cancelled, 79 jobs re-attached, no job ended as an error by 14:51Z. **18:30Z 11-17 (production 2885a521, your promote): the seventh start.** The start ended no run and erred no job. Seven CI checks had jobs on both sides of it; per check, from `t.job_history`, counted as at 14:35Z: | run, check | jobs ended before the restart / still running at it | jobs started in the 11 min after | of them at most re-runs | |---|---|---|---| | r02d57fe3d6 test/tilo-session | 52 / 5 | 54 | 52 | | r02d57fe3d6 test/tilo-session-client | 18 / 2 | 16 | 16 | | r2b5d510336 test-x86_64/tilo-agent-session | 10 / 26 | 10 | 10 | | r5e6d682621 test/tilo-session-client | 9 / 2 | 14 | 9 | | three more checks | 1 / 4 | 4 | 1 | At most 88 ended shards were run again at this start, the most of the day's seven (at most 196 in all). Part A held again: 39 jobs were running at the start and none of them erred. **23:32Z 11-17 (production 7710cc0d, your promote): the eighth start.** The start ended no run with an error and erred no job; the worker re-attached 117 jobs. Thirty CI and probe checks in nine runs had jobs on both sides of it; from `t.job_history`, counted at 00:05Z, 33 minutes after: | check (runs) | jobs ended before the restart | jobs started after | of them at most re-runs | |---|---|---|---| | test/tilo-workspace-host (2) | 18 | 17 | 17 | | test/video-editor (1) | 7 | 16 | 7 | | test/tilo-session (1) | 4 | 33 | 4 | | test/word-processor (1) | 7 | 3 | 3 | | test-x86_64/tilo-agent-session (1) | 34 | 2 | 2 | | test/notes (1) | 34 | 2 | 2 | | test/tasks (1) | 8 | 2 | 2 | | test/tilo-action-broker (1) | 3 | 2 | 2 | | all 30 checks | 142, and 49 running at it | 154 | 63 | At most 63 ended shards were run again at this start (per check the smaller of the two counts, summed), which makes at most 259 over the day's eight starts. The window is longer than the 11 minutes of the row above, so more of the 154 are first runs. Part A held again: 49 jobs were running at the start and none erred. **01:21Z 11-18 (production ab189001, your promote): the ninth start.** Counted at 01:52Z, half an hour after: one check in one run had jobs on both sides of it (`test/tilo-cli`: 1 job ended before the restart, none running at it, 2 started after), so at most 1 ended shard was run again, the fewest of any start read here; no check was given a second job while its first still ran. Part A held for 54 of the 55 jobs that ran across it; the one that erred is not this fault but the crate refusal across the worker's upgrade (#63, j605-532). **03:29Z 11-18 (production 7d7c6593, your promote): the tenth start.** Counted at 04:00Z, half an hour after: five checks in three runs had jobs on both sides of it. | check (runs) | jobs ended before the restart | jobs started after | of them at most re-runs | |---|---|---|---| | test-idle/tilo-ui (1) | 35 | 34 | 34 | | test-x86_64/tilo-agent-session (1) | 19 | 25 | 19 | | test-x86_64/tilolang-cli (1) | 14 | 16 | 14 | | test/tilo-server (1) | 10 | 62 | 10 | | test/tilo-session (1) | 1 | 45 | 1 | | all five | 79, and 7 running at it | 182 | 78 | At most 78 ended shards were run again. No check was given a second job while its first still ran. No job erred across the restart for this; the five that erred around it are the set-up stall of #84. **05:05:22Z 11-18, the start of 85866e52 (read 05:36Z, same statement):** 3 pairs of a run and a check of class ci or probe had a job ended before the start and one started after it, re-runs at most 22. The rows so far: 18:30Z at most 88, 23:32Z at most 63, 01:21Z at most 1, 03:29Z at most 78, 05:05Z at most 22. No check of a run was given a second job beside a first that still ran. 12 heads were asked in the half hour after and 9 judged. **07:32:33Z and 08:17:41Z 11-18, the starts of 06f61244 and d748ed8d (same statement, each read half an hour after):** 07:32Z: 0 pairs, 0 re-runs, the first restart with none. 08:17Z: 1 pair, at most 1 re-run. The rows so far: 18:30Z at most 88, 23:32Z at most 63, 01:21Z at most 1, 03:29Z at most 78, 05:05Z at most 22, 07:32Z 0, 08:17Z at most 1. At neither start was a check of a run given a second job beside a first that still ran. The 08:17Z start came during a stop of head runs (issue 102), so few CI jobs ran across it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tilo/t#86
No description provided.