Commit 4bd2713
Clean up multiprocessing pools on failure
Ensure bagit-python reliably cleans up multiprocessing pools when parallel
manifest generation or validation fails with processes > 1.
Successful make_bag() calls already cleaned up correctly through the normal
graceful pool path. The gap was failures inside Pool.map(): worker
exceptions skipped close() and join(), allowing BagIt child processes to remain
alive after the caller received the error. In long-running services, those
leftover children can later become orphaned or defunct when the owning worker
exits.
This follows up on c451b24 ("Wait for validation Pool to finish"), the
validation-pool cleanup work Douglas and I did, by extending the same
reliability expectation to failure paths.1 parent 462f6b0 commit 4bd2713
2 files changed
Lines changed: 60 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
899 | | - | |
900 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
901 | 904 | | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1040 | 1059 | | |
1041 | 1060 | | |
1042 | 1061 | | |
| |||
1245 | 1264 | | |
1246 | 1265 | | |
1247 | 1266 | | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1252 | 1270 | | |
1253 | 1271 | | |
1254 | 1272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
458 | 457 | | |
459 | 458 | | |
460 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
461 | 477 | | |
462 | 478 | | |
463 | 479 | | |
| |||
745 | 761 | | |
746 | 762 | | |
747 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
748 | 779 | | |
749 | 780 | | |
750 | 781 | | |
| |||
0 commit comments