Repository navigation
Commit da3a42d
#6: a JSON-RPC response with a non-numeric id was logged at debug level
and silently dropped, leaving the pending future to resolve only via its
60s timeout. Every id we send is one of our own ints (self._next_id), so
this only happens on non-conformant server behavior — worth a warning,
not routine tracing noise. Left the pending future alone rather than
guessing which request it belonged to (forcibly resolving "the" pending
future when exactly one is in flight risks failing an unrelated request
if the message turns out to be unrelated noise).
#8: the comment on the oversized-line ValueError handler in _read_stdout
claimed CPython's StreamReader keeps the buffered data around so
subsequent readline() calls "drain the oversized line in fragments".
That's not what CPython does: per StreamReader.readline()'s own
docstring, on overrun the buffer is either trimmed up to and including
the next separator it already contains (clean single-line loss) or
cleared entirely if no separator has arrived yet (only the latter case
can surface a later fragment, and it self-terminates — no draining loop
required). Corrected the comment to describe the actual behavior; no
functional change, the recovery loop was already correct.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 1cf396d commit da3a42d
2 files changed
Lines changed: 57 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
352 | 365 | | |
353 | 366 | | |
354 | 367 | | |
| |||
392 | 405 | | |
393 | 406 | | |
394 | 407 | | |
395 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
396 | 422 | | |
397 | 423 | | |
398 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
197 | 222 | | |
198 | 223 | | |
0 commit comments