Skip to content

Clean up multiprocessing pools on failure#208

Open
sevein wants to merge 1 commit into
LibraryOfCongress:masterfrom
artefactual-labs:dev/pool-fix
Open

Clean up multiprocessing pools on failure#208
sevein wants to merge 1 commit into
LibraryOfCongress:masterfrom
artefactual-labs:dev/pool-fix

Conversation

@sevein

@sevein sevein commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant