Improve reliability issues in Courier services #320
Merged
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.
Fixes #319 (hopefully).
I'm not sure why it happens, but there are cases where the spawned processes die without exception. You can simulate this by killing a process manually. In this case, the Courier will never return and your calls will simply wait forever.
This PR will update the courier to correctly link the children and listen for their termination; allowing us to cleanup and pass something back to callers. The newly added test case fails without these changes, it hangs forever. With the changes, it correctly terminates and passes the results to the caller.
I am not sure about handling the errors inside the spawned children anymore; we can just let the process die and bubble it back up to the caller (we could even just
raise ExecutionError
, but that makes a bit of logging noise). I'll probably look at this again in future, but I don't want to balloon the scope of these changes for now.