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
[flutter_tool] Only send one crash report per run #38925
Conversation
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.
LGTM
I wonder if this explains the relatively high volume/low users of the frontend_server crash?
time.elapse(const Duration(seconds: 1)); | ||
time.flushMicrotasks(); | ||
}); | ||
expect(await exitCodeCompleter.future, equals(1)); |
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.
nit: I would use expect(await foo, 1)
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.
Done.
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.
I think it was the cause of the profile we are seeing from the frontend server crashers. I cycled through the error messages for a master version, and there was a discernible pattern.
Codecov Report
@@ Coverage Diff @@
## master #38925 +/- ##
==========================================
- Coverage 56.26% 55.44% -0.83%
==========================================
Files 195 195
Lines 18314 18316 +2
==========================================
- Hits 10305 10155 -150
- Misses 8009 8161 +152
Continue to review full report at Codecov.
|
Description
Prior to this PR, if there are multiple unhandled exceptions in a single invocation of the tool, they will all be sent to crash reporting. This is problematic when a stream with lots of data has a listener callback that throws a synchronous exception. The same 'crash' will generate potentially hundreds of reports until the event loop turns enough times for the tool to exit.
This PR ensures that only the first unhandled exception will be sent to crash reporting. Subsequent unhandled exceptions will still be logged to the console and/or a crash log file.
Related Issues
Noise/duplicates in crash reporting.
Tests
I added the following tests:
New test in crash_reporting_test.dart.
Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?