Commit 114c0a0
root
host: fix flynn run --enable-log hang caused by OOM logger WaitGroup leak
The OOM notification logger shared the container's MuxConfig (same JobID),
causing Follow() to add a 4th entry to the job's WaitGroup. Since cleanup()
only closes the 3 tracked stdio streams, the WaitGroup never reached zero,
blocking jobDoneCh() forever and preventing AttachExit from being sent.
Fix by giving the OOM logger a separate config with a distinct JobID so it
gets its own independent WaitGroup. Also fix the Attach deferred func to
handle the case where the container exits before client is set, and add a
jobDones map to logmux so late subscribers can detect already-finished jobs.
Fixes: TestRun, TestRunSignal, TestLog, TestLogFilter, TestLogFollow,
TestLogStderr (all were hanging indefinitely).1 parent df22756 commit 114c0a0
3 files changed
Lines changed: 31 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
| 627 | + | |
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1161 | 1161 | | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | | - | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1165 | 1169 | | |
1166 | 1170 | | |
1167 | 1171 | | |
| |||
1397 | 1401 | | |
1398 | 1402 | | |
1399 | 1403 | | |
1400 | | - | |
1401 | | - | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1402 | 1408 | | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1403 | 1412 | | |
1404 | 1413 | | |
1405 | 1414 | | |
1406 | 1415 | | |
1407 | | - | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
1408 | 1419 | | |
1409 | 1420 | | |
1410 | 1421 | | |
| |||
1485 | 1496 | | |
1486 | 1497 | | |
1487 | 1498 | | |
| 1499 | + | |
1488 | 1500 | | |
1489 | 1501 | | |
| 1502 | + | |
1490 | 1503 | | |
1491 | 1504 | | |
1492 | 1505 | | |
| |||
1508 | 1521 | | |
1509 | 1522 | | |
1510 | 1523 | | |
| 1524 | + | |
1511 | 1525 | | |
1512 | 1526 | | |
1513 | 1527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
| 326 | + | |
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
| |||
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
406 | | - | |
407 | | - | |
| 411 | + | |
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
411 | 415 | | |
412 | 416 | | |
413 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
414 | 423 | | |
415 | 424 | | |
416 | 425 | | |
| |||
449 | 458 | | |
450 | 459 | | |
451 | 460 | | |
| 461 | + | |
452 | 462 | | |
453 | 463 | | |
454 | 464 | | |
| |||
0 commit comments