Skip to content

Clean up error handling for report persistence #1387

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

Merged
merged 4 commits into from
Mar 24, 2020

Conversation

mrwillis21
Copy link
Contributor

Ensure data written to disk is cleaned up properly when
read/write/serialization errors occur.

Ensure data written to disk is cleaned up properly when
read/write/serialization errors occur.
@googlebot googlebot added the cla: yes Override cla label Mar 24, 2020
@mrwillis21 mrwillis21 requested a review from mrichards March 24, 2020 20:30
@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #1387 into master will decrease coverage by 23.21%.
The diff coverage is 0%.

Flag Coverage Δ Complexity Δ
#Encoders_FirebaseEncodersJson 95.93% <ø> (ø) 68 <ø> (ø) ⬇️
#Encoders_FirebaseEncodersProcessor ? ?
#Encoders_FirebaseEncodersReflective 73.97% <ø> (ø) 20 <ø> (ø) ⬇️
#FirebaseAbt ? ?
#FirebaseCommon ? ?
#FirebaseCommon_DataCollectionTests ? ?
#FirebaseCommon_Ktx ? ?
#FirebaseComponents ? ?
#FirebaseConfig ? ?
#FirebaseConfig_Ktx ? ?
#FirebaseCrashlytics 2.41% <0%> (-0.03%) 22 <0> (ø)
#FirebaseDatabase ? ?
#FirebaseDatabaseCollection ? ?
#FirebaseDatabase_Ktx ? ?
#FirebaseDatatransport 100% <ø> (ø) 3 <ø> (ø) ⬇️
#FirebaseDynamicLinks ? ?
#FirebaseDynamicLinks_Ktx ? ?
#FirebaseFirestore ? ?
#FirebaseFirestore_Ktx ? ?
#FirebaseFunctions ? ?
#FirebaseFunctions_Ktx ? ?
#FirebaseInappmessaging 51.52% <ø> (ø) 528 <ø> (ø) ⬇️
#FirebaseInappmessagingDisplay 34.52% <ø> (ø) 129 <ø> (ø) ⬇️
#FirebaseInappmessagingDisplay_Ktx 100% <ø> (ø) 0 <ø> (ø) ⬇️
#FirebaseInappmessaging_Ktx 100% <ø> (ø) 0 <ø> (ø) ⬇️
#FirebaseInstallations ? ?
#FirebaseSegmentation ? ?
#FirebaseStorage ? ?
#FirebaseStorage_Ktx ? ?
#Tools_Errorprone ? ?
#Tools_Lint ? ?
#Transport_TransportBackendCct 91.38% <ø> (ø) 96 <ø> (ø) ⬇️
#Transport_TransportRuntime ? ?

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f5146f...052fc33. Read the comment docs.

@@ -46,7 +46,13 @@ public CrashlyticsUncaughtExceptionHandler(
public void uncaughtException(Thread thread, Throwable ex) {
isHandlingException.set(true);
try {
crashListener.onUncaughtException(settingsDataProvider, thread, ex);
if (thread == null) {
Logger.getLogger().d("Could not handle uncaught exception; null thread");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making some of this output logged as errors, since they are basically logging failed asserts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this particular case that makes sense.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 24, 2020

Binary Size Report

Affected SDKs

SDKTypeBase (5db2238)Head (052fc33)Diff
firebase-inappmessagingapk (release)?3256643.00? (?)
aar?467661.00? (?)
apk (aggressive)?601342.00? (?)
firebase-common:ktxaar?5965.00? (?)
protolite-well-known-typesapk (release)?561089.00? (?)
aar?1203203.00? (?)
apk (aggressive)?122385.00? (?)
firebase-inappmessaging:ktxaar?5003.00? (?)
firebase-segmentationapk (release)?1667839.00? (?)
aar?35427.00? (?)
apk (aggressive)?1017155.00? (?)
firebase-database:ktxaar?6706.00? (?)
firebase-functions:ktxaar?5844.00? (?)
firebase-storageapk (release)?976604.00? (?)
aar?119257.00? (?)
apk (aggressive)?325645.00? (?)
firebase-commonapk (release)?646638.00? (?)
aar?34517.00? (?)
apk (aggressive)?82943.00? (?)
encoders:firebase-encoders-jsonaar?15335.00? (?)
firebase-firestore:ktxaar?7093.00? (?)
firebase-crashlytics-ndkapk (release)?1936966.00? (?)
aar?598746.00? (?)
apk (aggressive)?1170708.00? (?)
transport:transport-apiaar?6439.00? (?)
transport:transport-backend-cctaar?38343.00? (?)
firebase-inappmessaging-display:ktxaar?22190.00? (?)
firebase-databaseapk (release)?1101570.00? (?)
aar?480458.00? (?)
apk (aggressive)?325596.00? (?)
encoders:firebase-encoders-reflectiveaar?7650.00? (?)
firebase-crashlyticsapk (release)?1353912.00? (?)
aar?400122.00? (?)
apk (aggressive)?584015.00? (?)
transport:transport-runtimeaar?122725.00? (?)
firebase-installationsapk (release)?665523.00? (?)
aar?55057.00? (?)
apk (aggressive)?84591.00? (?)
firebase-config:ktxaar?6162.00? (?)
firebase-dynamic-linksapk (release)?951227.00? (?)
aar?51149.00? (?)
apk (aggressive)?327462.00? (?)
firebase-storage:ktxaar?6143.00? (?)
firebase-installations-interopapk (release)?616109.00? (?)
aar?7509.00? (?)
apk (aggressive)?61724.00? (?)
firebase-componentsapk (release)?25749.00? (?)
aar?34495.00? (?)
apk (aggressive)?10970.00? (?)
firebase-abtapk (release)?746406.00? (?)
aar?35383.00? (?)
apk (aggressive)?85720.00? (?)
firebase-configapk (release)?1143995.00? (?)
aar?214548.00? (?)
apk (aggressive)?395836.00? (?)
firebase-datatransportapk (release)?711393.00? (?)
aar?5041.00? (?)
apk (aggressive)?116368.00? (?)
firebase-dynamic-links:ktxaar?7877.00? (?)
firebase-inappmessaging-displayapk (release)?4520175.00? (?)
aar?165930.00? (?)
apk (aggressive)?1603047.00? (?)
firebase-functionsapk (release)?1178560.00? (?)
aar?25859.00? (?)
apk (aggressive)?393474.00? (?)
firebase-database-collectionapk (release)?912665.00? (?)
aar?34214.00? (?)
apk (aggressive)?313624.00? (?)
firebase-firestoreapk (release)?3139586.00? (?)
aar?1067163.00? (?)
apk (aggressive)?443199.00? (?)
baseapk (release)?8754.00? (?)
apk (aggressive)?10679.00? (?)
Metric Unit: byte

Test Logs

// called on app start, but keep the current session when called at crash time. Currently
// this only works when called at app start.
List<File> sessionDirectories = capAndGetOpenSessions(currentSessionId);
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot cleaner! 😍

Copy link
Contributor

@mrichards mrichards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this all looks great. I'd like to see all the debug logging for error conditions use the ERROR log level (or WARN, where appropriate) instead of debug. I'm going to approve the PR as-is so you don't need to wait to merge once those trivial changes are made.

Nice job!

@mrwillis21
Copy link
Contributor Author

/test device-check-changed

@mrwillis21 mrwillis21 merged commit b878917 into master Mar 24, 2020
@mrwillis21 mrwillis21 deleted the crashlytics-clean-up-error-handling branch March 24, 2020 22:14
@firebase firebase locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants