|
|
Created:
4 years, 3 months ago by Ilya Sherman Modified:
4 years, 3 months ago CC:
chromium-reviews, kalyank, sadrul, jwd, Maria Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[Android] Delete old crash reports
Unsent crash reports can currently accumulate indefinitely, costing
users storage space. This CL limits (1) the maximum number of unsent
reports that will be saved, and (2) the maximum age of a report.
BUG=641628
TEST=CrashFileManagerTest.*
Committed: https://crrev.com/f31ae5c0f5cc1f2337e16c68fdc3048336eff666
Cr-Commit-Position: refs/heads/master@{#415838}
Patch Set 1 #Patch Set 2 : Suppress irrelevant build warnings #
Total comments: 10
Patch Set 3 : Fix test and rearrange age check #
Total comments: 4
Patch Set 4 : Test cleanup of old files as well #Patch Set 5 : Rebase #Patch Set 6 : Rebase harder #
Messages
Total messages: 40 (25 generated)
The CQ bit was checked by isherman@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
isherman@chromium.org changed reviewers: + dfalcantara@chromium.org, gayane@chromium.org
Gayane, PTAL from the metrics/crash reporting team perspective. (Jesse, I listed you as FYI, but feel free to review as well if you'd like to.) Dan, PTAL from an OWNERS perspective. I rarely code in Java, so please don't hesitate to nitpick =) (The nearest owners for this file that I found were from //chrome/android/OWNERS. Is that normal? Not that I mind -- just don't want to overload y'all with code reviews.)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...)
The CQ bit was checked by isherman@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
Thanks Ilya. https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java (right): https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:173: protected File[] getAllFilesSorted() { Should we make getAllFilesSorted function to return all the minidumps and rename getAllMinidumpFilesSorted function to return all the minidump files that are available for upload ? https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:203: String fileNameSansExtension = f.getName().split("\\.")[0]; According to the filenameWithIncrementedAttemptNumber I can see that it build the suffix as .dmp.try1 in which case this code here will work as expected. but for some reason in tests minidumps can have .dmp.try1 or .try1.dmp suffixies. I am not sure this is needed, but is this considered here? would it match to logcat filename in both cases? https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:214: if (ageInDays > MAX_CRASH_REPORT_AGE_IN_DAYS) { Shouldn't this be before we decide to add the report to recentCrashes ? https://codereview.chromium.org/2280313002/diff/20001/chrome/android/javatest... File chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadCallableTest.java (right): https://codereview.chromium.org/2280313002/diff/20001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadCallableTest.java:381: File logfile = new File(mCacheDir, CrashFileManager.CRASH_DUMP_LOGFILE); mCrashDir
Description was changed from ========== [Android] Delete old crash reports Unsent crash reports can currently accumulate indefinitely, costing users storage space. This CL limits (1) the maximum number of unsent reports that will be saved, and (2) the maximum age of a report. BUG=641628 TEST=CrashFileManagerTest.* ========== to ========== [Android] Delete old crash reports Unsent crash reports can currently accumulate indefinitely, costing users storage space. This CL limits (1) the maximum number of unsent reports that will be saved, and (2) the maximum age of a report. BUG=641628 TEST=CrashFileManagerTest.* ==========
https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java (right): https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:173: protected File[] getAllFilesSorted() { On 2016/08/29 18:56:47, gayane wrote: > Should we make getAllFilesSorted function to return all the minidumps and rename > getAllMinidumpFilesSorted function to return all the minidump files that are > available for upload ? The intention is for getAllFilesSorted() to return *all* files -- originally named minidump files, renamed minidump files, logcat files, temporary files, and anything else that might have somehow snuck into this directory. I'm happy to clear up other function names, though would probably prefer to do so in a separate CL. What name would you suggest to replace getAllMinidumpFilesSorted()? It's a bit weird currently because "foo.dmp" and "foo.up0" are both minidump files in terms of their contents, but only "foo.dmp" is considered a "minidump file" by the method, because the method is really looking at filename extensions, rather than contents. But, that's kind of how most of this class works :/ https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:203: String fileNameSansExtension = f.getName().split("\\.")[0]; On 2016/08/29 18:56:47, gayane wrote: > According to the filenameWithIncrementedAttemptNumber I can see that it build > the suffix as .dmp.try1 in which case this code here will work as expected. > but for some reason in tests minidumps can have .dmp.try1 or .try1.dmp > suffixies. I am not sure this is needed, but is this considered here? would it > match to logcat filename in both cases? Yeah, I'm not sure why tests allow ".try1.dmp" as a suffix. But, I believe this code is robust to that -- "foo.try1.dmp" and "foo.dmp.try1" will both have the base name "foo", and the corresponding logcat file should be "foo.logcat". I haven't seen any code that might change the "foo" part of the name. Is there any particular input case that you're concerned about, that I might be overlooking? https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:214: if (ageInDays > MAX_CRASH_REPORT_AGE_IN_DAYS) { On 2016/08/29 18:56:47, gayane wrote: > Shouldn't this be before we decide to add the report to recentCrashes ? The behavior should be equivalent, but I agree it might be clearer as you suggest. Rearranged. https://codereview.chromium.org/2280313002/diff/20001/chrome/android/javatest... File chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadCallableTest.java (right): https://codereview.chromium.org/2280313002/diff/20001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadCallableTest.java:381: File logfile = new File(mCacheDir, CrashFileManager.CRASH_DUMP_LOGFILE); On 2016/08/29 18:56:47, gayane wrote: > mCrashDir Done.
The CQ bit was checked by isherman@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java (right): https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:173: protected File[] getAllFilesSorted() { On 2016/08/29 22:33:01, Ilya Sherman wrote: > On 2016/08/29 18:56:47, gayane wrote: > > Should we make getAllFilesSorted function to return all the minidumps and > rename > > getAllMinidumpFilesSorted function to return all the minidump files that are > > available for upload ? > > The intention is for getAllFilesSorted() to return *all* files -- originally > named minidump files, renamed minidump files, logcat files, temporary files, and > anything else that might have somehow snuck into this directory. > > I'm happy to clear up other function names, though would probably prefer to do > so in a separate CL. What name would you suggest to replace > getAllMinidumpFilesSorted()? It's a bit weird currently because "foo.dmp" and > "foo.up0" are both minidump files in terms of their contents, but only "foo.dmp" > is considered a "minidump file" by the method, because the method is really > looking at filename extensions, rather than contents. But, that's kind of how > most of this class works :/ I would imagine smth like getAllAvailableMinidumpSorted but this gets too long https://codereview.chromium.org/2280313002/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/crash/CrashFileManager.java:203: String fileNameSansExtension = f.getName().split("\\.")[0]; On 2016/08/29 22:33:01, Ilya Sherman wrote: > On 2016/08/29 18:56:47, gayane wrote: > > According to the filenameWithIncrementedAttemptNumber I can see that it build > > the suffix as .dmp.try1 in which case this code here will work as expected. > > but for some reason in tests minidumps can have .dmp.try1 or .try1.dmp > > suffixies. I am not sure this is needed, but is this considered here? would it > > match to logcat filename in both cases? > > Yeah, I'm not sure why tests allow ".try1.dmp" as a suffix. But, I believe this > code is robust to that -- "foo.try1.dmp" and "foo.dmp.try1" will both have the > base name "foo", and the corresponding logcat file should be "foo.logcat". I > haven't seen any code that might change the "foo" part of the name. > > Is there any particular input case that you're concerned about, that I might be > overlooking? no, particular input, just misunderstood the split part. Didn't think it picks "foo" as in your example.
isherman@chromium.org changed reviewers: + mariakhomenko@chromium.org
Dan or Maria, could one of you PTAL for OWNERS approval? Thanks!
lgtm Sorry about the delay; did 8 or 9 yesterday and my brain got a bit fried.
lgtm https://codereview.chromium.org/2280313002/diff/40001/chrome/android/javatest... File chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java (right): https://codereview.chromium.org/2280313002/diff/40001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java:203: String prefix = "chromium-renderer-minidump-deadbeef" + Integer.toString(i); nit: any reason not to just do "chromium..." + i; here? https://codereview.chromium.org/2280313002/diff/40001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java:252: // are deleted, which would require setting fake timestamps. You can set last modified date through File api: https://docs.oracle.com/javase/7/docs/api/java/io/File.html#setLastModified(l....
https://codereview.chromium.org/2280313002/diff/40001/chrome/android/javatest... File chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java (right): https://codereview.chromium.org/2280313002/diff/40001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java:203: String prefix = "chromium-renderer-minidump-deadbeef" + Integer.toString(i); On 2016/08/30 16:58:40, Maria wrote: > nit: any reason not to just do "chromium..." + i; here? Done. I had assumed it was poor style or something :P https://codereview.chromium.org/2280313002/diff/40001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/crash/CrashFileManagerTest.java:252: // are deleted, which would require setting fake timestamps. On 2016/08/30 16:58:40, Maria wrote: > You can set last modified date through File api: > https://docs.oracle.com/javase/7/docs/api/java/io/File.html#setLastModified(l.... Ah, nice -- thanks! Done.
The CQ bit was checked by isherman@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from gayane@chromium.org, dfalcantara@chromium.org, mariakhomenko@chromium.org Link to the patchset: https://codereview.chromium.org/2280313002/#ps60001 (title: "Test cleanup of old files as well")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by isherman@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from gayane@chromium.org, dfalcantara@chromium.org, mariakhomenko@chromium.org Link to the patchset: https://codereview.chromium.org/2280313002/#ps80001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...)
The CQ bit was checked by isherman@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from gayane@chromium.org, dfalcantara@chromium.org, mariakhomenko@chromium.org Link to the patchset: https://codereview.chromium.org/2280313002/#ps100001 (title: "Rebase harder")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== [Android] Delete old crash reports Unsent crash reports can currently accumulate indefinitely, costing users storage space. This CL limits (1) the maximum number of unsent reports that will be saved, and (2) the maximum age of a report. BUG=641628 TEST=CrashFileManagerTest.* ========== to ========== [Android] Delete old crash reports Unsent crash reports can currently accumulate indefinitely, costing users storage space. This CL limits (1) the maximum number of unsent reports that will be saved, and (2) the maximum age of a report. BUG=641628 TEST=CrashFileManagerTest.* ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== [Android] Delete old crash reports Unsent crash reports can currently accumulate indefinitely, costing users storage space. This CL limits (1) the maximum number of unsent reports that will be saved, and (2) the maximum age of a report. BUG=641628 TEST=CrashFileManagerTest.* ========== to ========== [Android] Delete old crash reports Unsent crash reports can currently accumulate indefinitely, costing users storage space. This CL limits (1) the maximum number of unsent reports that will be saved, and (2) the maximum age of a report. BUG=641628 TEST=CrashFileManagerTest.* Committed: https://crrev.com/f31ae5c0f5cc1f2337e16c68fdc3048336eff666 Cr-Commit-Position: refs/heads/master@{#415838} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/f31ae5c0f5cc1f2337e16c68fdc3048336eff666 Cr-Commit-Position: refs/heads/master@{#415838} |