Commit 3029f52
fix(grpc): drain log stream gracefully on success path in solve_lp/mip
stop_log_streaming() calls TryCancel() which races against the server's
final log drain: poll_for_completion() returns as soon as the job is
marked complete, then TryCancel() kills the stream before the server has
finished sending remaining lines (e.g. "Best objective …").
Add drain_log_streaming(): polls log_stream_done_ (set when the thread
exits naturally after receiving the job_complete sentinel) for up to 5s,
then falls back to stop_log_streaming(). Use it on the success path in
solve_lp and solve_mip so all final log lines are received before the
stream is torn down.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>1 parent 25af2f2 commit 3029f52
2 files changed
Lines changed: 34 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| 291 | + | |
290 | 292 | | |
291 | 293 | | |
292 | 294 | | |
| |||
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
311 | 328 | | |
312 | 329 | | |
313 | 330 | | |
| |||
848 | 865 | | |
849 | 866 | | |
850 | 867 | | |
851 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
852 | 875 | | |
853 | 876 | | |
854 | 877 | | |
| |||
875 | 898 | | |
876 | 899 | | |
877 | 900 | | |
878 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
879 | 906 | | |
880 | 907 | | |
881 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
411 | 415 | | |
412 | 416 | | |
413 | 417 | | |
| |||
419 | 423 | | |
420 | 424 | | |
421 | 425 | | |
| 426 | + | |
422 | 427 | | |
423 | 428 | | |
424 | 429 | | |
| |||
0 commit comments