-
Notifications
You must be signed in to change notification settings - Fork 212
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
Lots of bug fixes relating to failed builds and recovery from them #550
Conversation
await buildStep.writeAsString( | ||
buildStep.inputId.changeExtension(jsModuleErrorsExtension), '$e'); | ||
log.severe('', e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty string? Weird?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just logging the error - it feels a bit weird for sure but there is already additional context provided by the loggers name (it is named based on the current builder and primary input).
The logger handles consistently formatting the error already as well - so that ends up being nicer than passing the error as the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...why no stack? Not useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya - we don't have a true stack trace here. This error is originating from a worker, and contains the entire message that the worker sent back - which may or may not contain a useful stack trace already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be sensible to add any unit tests specifically around replacing a SyntheticAssetNode
with a real one? We probably want to make sure it works for it to get replaced with either a source or generated file.
The changes LGTM.
Ya, this is effectively being tested with the ddc error recovery e2e test, but some unit tests would be good as well, I can work on that. |
Travis is having issues today, going to run with a local |
SyntheticAssetNode
. These are created if a build step callscanRead
for an asset that doesn't exist. Those files still need to be tracked so if they are added later on that build step gets invalidated.scopeLog
toscopeLogAsync
, since its always used in an async context, and we now run in an error handling zone that logs errors tologger.severe
. Any call toscopeLogAsync
is now guaranteed to eventually complete with exactly one error or value, and will not leak unhandled async errors.runBuilder
to pass in a logger whose name is$builder on $input
, so you get more context for errors.computeTransitiveModules
to check that modules exist before trying to read them, and warn if they don't. Eventually we probably want this to fail the build as well, but only on some equivalent of "--mode=release". For dev time we probably don't want any builds to fail so the app can serve errors in a friendly fashion.updateAndInvalidate
where it would delete nodes that shouldn't be deleted.Fixes #548.