Commit 4178021
Clean up runtime cancellation and logging follow-ups
Address pre-existing follow-ups surfaced during PR review:
- TransmissionPolicyManager: fix three LOG_TRACE calls that used %d for
uint64_t / chrono::milliseconds::rep values. The negative-delay log was
already corrected; this extends the same fix to the WAIT / SCHED /
reschedule traces so all delay logging is portable.
- WorkerThread: remove the dead 'count' member. It was incremented in
Join() and Queue() but never read or decremented anywhere.
- HttpClient_Apple::CancelAllRequests: cancel each in-flight request
under a single critical section instead of collecting ids, releasing
the mutex, and calling CancelRequestAsync per id. The previous pattern
opened a small window where the request could complete and be erased
between the two locked sections. The spin-wait that follows now also
meaningfully blocks until each NSURLSession completion handler has
fired and the corresponding HttpRequestApple destructor has removed
itself via HttpClient_Apple::Erase, which is the actual signal that
cancellation has settled.
Validation:
- Host UnitTests on macOS arm64: 488/488 pass.
- TransmissionPolicyManagerTests + HttpClientManagerTests +
HttpResponseDecoderTests --gtest_repeat=10: 46/46 each round.
- iphonesimulator and iphoneos -fsyntax-only of HttpClient_Apple.mm
both clean.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 05bd377 commit 4178021
3 files changed
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | 189 | | |
191 | 190 | | |
192 | | - | |
193 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | | - | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
| |||
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
129 | | - | |
130 | 127 | | |
131 | 128 | | |
132 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
203 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| |||
264 | 268 | | |
265 | 269 | | |
266 | 270 | | |
267 | | - | |
| 271 | + | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
0 commit comments