Repository navigation
Commit 2d39794
committed
session: a program read no longer ends the drain when its root has no summary
CI failed `a_header_read_in_two_programs_answers_each_its_own_way` with `both translation units are read:
["/p/a.cpp"]` — one program read, the other silently not — and it passed locally on the same commit. It is not a
platform difference: it is a race between the index and the unit schedule, and a slower machine loses it.
The two adjacent lines: `the_next_unit_to_read` deliberately accepts an open file whose summary is absent (its module
question is `is_none_or`), so the drain may ask for the program of a file the index has not caught up with — and
`gather_a_unit_read` began with `summary(root)?`, so the read returned `None`, `read_a_looked_at_unit` returned `None`,
and the caller's `while let Some(reading)` loop ended with a translation unit unread and no diagnostic anywhere.
The caller that asks for a program now does the one parse the program needs: `read_a_looked_at_unit` checks
`summary(&root)` and, when it is missing, runs the pump's own `index_one` for that root before `read_the_unit`. Nothing
new is introduced, and the cost is one parse the index owed anyway.
Pinned by `session::tests::a_program_is_read_before_its_root_has_a_summary`, which builds the state deliberately — two
open files and no `index_everything`, so neither has a summary:
without the fix: assertion failed: both open files are read, summary or not: []
with the fix: both are read, and the CI test passes
The assertion counts programs read rather than waiting on a timeout, so it asks the same question on every platform.
The failing test is not disabled and no retry was added: the schedule is what changed.
`docs/buglist.md` section 14 records it, with the mechanism and both measurements.1 parent ddc682c commit 2d39794
3 files changed
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7071 | 7071 | | |
7072 | 7072 | | |
7073 | 7073 | | |
| 7074 | + | |
| 7075 | + | |
| 7076 | + | |
| 7077 | + | |
| 7078 | + | |
| 7079 | + | |
| 7080 | + | |
| 7081 | + | |
| 7082 | + | |
| 7083 | + | |
7074 | 7084 | | |
7075 | 7085 | | |
7076 | 7086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2137 | 2137 | | |
2138 | 2138 | | |
2139 | 2139 | | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
2140 | 2174 | | |
2141 | 2175 | | |
2142 | 2176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
290 | 319 | | |
291 | 320 | | |
292 | 321 | | |
| |||
0 commit comments