Repository navigation
Handle solids hanging during multi-process - #18
Open
alexvalentine94 wants to merge 5 commits into
Open
alexvalentine94 wants to merge 5 commits into
alexvalentine94 wants to merge 5 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-solid timeout and log file fix
Summary
A single solid stuck inside OpenCASCADE (an endless loop in
IntPatch_WLine::ComputeVertexParameters) could hang a whole multiprocess decomposition, becauseProcessPoolExecutorcannot stop one worker. Separately, spawned workers wipedanalysis/logging.log.Changes
split_solid_timeoutdecomposition parameter (default 300 s, 0 = no limit). A solid that runs past it has its worker stopped and replaced, and is saved tofailed_to_convertwith the reason. The remaining solids carry on.run_with_timeoutindecomposemultiprocess.pyreplacesProcessPoolExecutorinDecomposer.run. It also replaces workers that die (e.g. a segfault), and returns results in input order.save_failed_solid, which both paths use. Behaviour is unchanged.mciobeforeparent_process()is set, withsys.argvcopied from the main process, so each new worker truncated the log (causing lost lines and NUL bytes).__init__.pynow also checkssys.orig_argvfor--multiprocessing-fork.Not changed
The decomposition logic itself (splitting, booleans, surfaces, void, output writers). The time limit doesn't apply to single-core or debug runs.
Testing
tests/unittests/test_decomposemultiprocess.py(9 tests): a stuck task, all workers stuck, a crashed worker, an exception in the task, result order, no limit, and a log-file regression test that fails on the old code.Notes
feature/ruff_fix, so merge that first.