Commit c42e474
authored
Fix deadlock if an MSBuild task is writing to stdout (#78927)
When we switched over to communicating over a named pipe rather than
stdin/stdout, we were still redirecting stdin and stdout. This had the
side effect that if a build task was directly writing to standard out,
the build would eventually deadlock since we weren't reading from the
other side.
I thought about simply not redirecting stdin/stdout, but I could imagine
other problems might come up if we were to have multiple build hosts
trying to share stdin/stdout. So now we'll log stdout the same way we
log stderr, and explicitly close stdin so readers won't deadlock waiting
for input.
Fixes #78766File tree
1 file changed
+9
-4
lines changed- src/Workspaces/MSBuild/Core/MSBuild
1 file changed
+9
-4
lines changedLines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
| 402 | + | |
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
| |||
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
415 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
| |||
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
424 | | - | |
| 429 | + | |
425 | 430 | | |
426 | 431 | | |
427 | 432 | | |
428 | 433 | | |
429 | 434 | | |
430 | 435 | | |
431 | | - | |
| 436 | + | |
432 | 437 | | |
433 | 438 | | |
434 | 439 | | |
| |||
0 commit comments