Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON to marshal errors from children #4717

Merged
merged 1 commit into from
Aug 17, 2018

Conversation

woodruffw
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This replaces our use of Marshal to send exceptions from child processes to their controlling parents with a JSON representation of the exception state. This JSON representation is then wrapped in a new exception class, ChildProcessError. For particularly interesting exceptions in child processes (namely BuildErrors), we reify the ChildProcessError back into its original exception (which keeps analytics and other parts of the codebase that use it directly happy).

@ghost ghost assigned woodruffw Aug 17, 2018
@ghost ghost added the in progress Maintainers are working on this label Aug 17, 2018
@woodruffw woodruffw requested a review from MikeMcQuaid August 17, 2018 19:27
@MikeMcQuaid MikeMcQuaid merged commit b8e276a into Homebrew:master Aug 17, 2018
@MikeMcQuaid
Copy link
Member

Thanks @woodruffw!

@ghost ghost removed the in progress Maintainers are working on this label Aug 17, 2018
@DomT4
Copy link
Member

DomT4 commented Aug 18, 2018

brew formula-analytics --days-ago=30 --json --build-error > _data/analytics/build-error/30d.json
Error: badRequest: Invalid JSON payload received. Unknown name "json_class" at 'report_requests[0].dimension_filter_clauses[0].filters[0].expressions[0]': Cannot find field.
Invalid JSON payload received. Unknown name "s" at 'report_requests[0].dimension_filter_clauses[0].filters[0].expressions[0]': Cannot find field.
Invalid JSON payload received. Unknown name "json_class" at 'report_requests[0].sampling_level': Cannot find field.
Invalid JSON payload received. Unknown name "s" at 'report_requests[0].sampling_level': Cannot find field.

Related?

@woodruffw
Copy link
Member Author

Yeah, looks like it. Hmm, I thought I handled the cases where we need real BuildErrors and not just ChildProcessErrors, but maybe I missed one.

@lock lock bot added the outdated PR was locked due to age label Sep 17, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants