[Android] Investigate some peculiar Minidump uploading edge-cases. |
||
Issue description
I've been playing around a bit with Chrome's Minidump uploading locally and investigated the code more thoroughly and it seems there are some weird edge-cases (maybe you - Ilya - can shed some light on these :))
1. A forced upload will only be tried once - just after we rename it to have the .forced suffix, shouldn't forced uploads be re-tried if they fail? (MINIDUMP_PATTERN doesn't cover forced files so they will never be picked up at later points where we try to upload all the minidumps).
2. Forced uploads skip the wifi-check (isUploadLimited()), is this intentional?
3. It's super ugly that MinidumpPreparationCallable just appends ".try0" to minidump files instead of having a utility method in CrashFileManager do this IMO :)
4. Shouldn't CrashFileManager.filenameWithForcedUploadState(String filename) operate on the MINIDUMP_PATTERN part of a file-name rather than on the whole file-name? E.g. if the file is named footry2foo.dmp0.try2 then filenameWithForcedUploadState will (theoretically) return the String footry3foo.dmp0.try3
5. getAllUploadedFiles seems incorrect given that an uploaded file can be named "foo.upX.tryY" (where X and Y are numbers) - the upload-pattern:
UPLOADED_MINIDUMP_PATTERN = Pattern.compile("\\.up([0-9]*)\\z");
doesn't capture files with a try-suffix after "upX". Right now this doesn't matter much - the only place getAllUploadedFiles is used is in cleanOutAllNonFreshMinidumpFiles, so the uploaded files should be cleaned up when they grow too old anyway (but it should be fixed :)).
All of this poses another related question:
Maybe we should introduce a suite of tests that tests the entire process of uploading minidumps - instead of just testing each component separately (I haven't looked much at MinidumpUploadServiceTest yet so I'm not sure how much that tests), i.e. mock all the external dependencies of the entire component - e.g. HttpUrlFactory, (and logcat extraction?) - and introduce tests where we go through entire uploads from start to end - and ensure that all files are correctly cleaned up in the end.
That kind of test should catch bugs like crbug.com/655631 as well. Not sure whether this would require applying a Whole Lotta Love to the current code though ;)
,
Oct 14 2016
1. Though if we start retrying forced uploads then we probably want to be even more clear that these can be done over a metered connection :) 4. I just think I will have to ensure we don't start naming Minidumps in an arbitrary way - to ensure we don't put something in there that will start clashing with any of the renaming code. I assume for Chrome the Minidumps are just named using a limited set of characters - hex? I'll prioritize doing the componentization but will happily take a look at these when I have time :) (and I realize you didn't do all of this - you seem to know the answers to my questions here though so that's super helpful :)).
,
Oct 14 2016
1. Yes, good point. That's probably reason enough not to retry the uploads for now -- the user can always tap the link again if need be. 4. I think it's basically lower-alphanum. Here's an example filename that I see: "chromium-renderer-minidump-b751f6a0ff4bb0ed". But, I'm not super confident that I understand how these files are named -- I haven't looked at that part of the code closely.
,
Apr 17 2017
Update: 1. This has been fixed (IIRC this was fixed by you Ilya ;), anyway - the code seems correct now). 2. Intentional (as per comment #1). 3. This has moved to MinidumpLogcatPrepender - I'm not sure we care enough about this change it. 4. there are several places in CrashFileManager where just filename.replace() some file-suffix with another - so if the actual filename contains any of our keywords it will be renamed incorrectly. 5. This was fixed by Ilya in https://codereview.chromium.org/2751903002
,
Jun 15 2017
Marking this as Fixed - I don't think I will look at any of the remaining issues (if we can even call them "issues" :)).
,
Jun 20 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by isherman@chromium.org
, Oct 13 2016Owner: gsennton@chromium.org