Repository navigation
Commit 4417eb2
committed
ADFA-4954 fix(kolibri): re-attach went silent, phase latched, margin truncated
Review fixes on the two commits below. Two of these break scenarios the ZIM
client never meets, which is why copying its shape carried them in unnoticed.
attach() went completely silent on a reused instance. `finished` short-circuits
both pollOnce() and fail(), so re-attaching after a seed had completed produced no
polling, no error and no callback — on the one method whose entire purpose is
recovering after the service restarts. Run state is now cleared on entry, before
the id check, and an empty id fails with its real cause instead of degrading into
ten 404s and "lost contact with the content service".
The indexing flag latched. RestContentClient can latch it because it handles one
ZIM; a Kolibri job walks several channels and re-enters processing once per
channel, so onIndexing() only ever fired for the first. Cleared on entering
downloading rather than only set on leaving it.
SeedPlan.requiredBytes divided before multiplying, truncating the remainder before
it was scaled. Real impact is ~108 bytes on a multi-gigabyte decision, so this is
small — but the test could not have caught it either way: it used 1000, which is
divisible by 100 and therefore identical under both orderings. Added a case with
1099, which distinguishes them (1100 truncated vs 1208 scaled), and one at
catalog scale to pin the absence of overflow now that the multiply comes first.
Also seed() with an empty plan now routes through done() so the double-callback
guard is armed rather than left open.
Not fixed, and noted rather than silently carried: `listener` and `pollErrors` are
non-volatile and touched from IO threads. The race is real but benign, and both
are inherited verbatim from RestContentClient — correcting one client and not the
other would be worse than the race. Worth its own pass over both.
Verified: all seven files parse; the arithmetic checked numerically against the
values the new tests assert. NOT COMPILED — no javac in the sandbox.1 parent a13d625 commit 4417eb2
3 files changed
Lines changed: 65 additions & 5 deletions
File tree
- controller/app/src
- main/java/org/iiab/controller/kolibri
- data
- domain
- test/java/org/iiab/controller/kolibri/domain
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
157 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
158 | 167 | | |
159 | 168 | | |
160 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
161 | 180 | | |
162 | 181 | | |
163 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
164 | 190 | | |
165 | 191 | | |
166 | 192 | | |
| |||
208 | 234 | | |
209 | 235 | | |
210 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
211 | 243 | | |
212 | 244 | | |
213 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
125 | 149 | | |
126 | 150 | | |
127 | 151 | | |
| |||
0 commit comments