New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 673097 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Fix Chrome minidump upload retry behaviour: don't retry unless on Wifi.

Project Member Reported by gsennton@chromium.org, Dec 10 2016

Issue description

Currently, the minidump upload logic for Chrome retries the uploading whenever the device network connection changes to a being connected. This happens in MinidumpUploadRetry.onConnectionTypeChanged:

@Override
public void onConnectionTypeChanged(int connectionType) {
    // Look for "favorable" connections. Note that we never
    // know what the user's crash upload preference is until
    // the time when we are actually uploading.
    if (connectionType == ConnectionType.CONNECTION_NONE) {
        return;
    }
    MinidumpUploadService.tryUploadAllCrashDumps(mContext);
    NetworkChangeNotifier.removeConnectionTypeObserver(this);
    sSingleton = null;
} 


However, we only upload minidumps on Wifi - so if we go from being disconnected to connected on a data-connection then this retry-logic will trigger tryUploadAllCrashDumps which will try to upload all the currently stored minidumps - and fail in MinidumpUploadCallable when calling

if (!mPermManager.isNetworkAvailableForCrashUploads()) {
    Log.i(TAG, "Minidump cannot currently be uploaded due to network constraints.");
    return UPLOAD_FAILURE;
}

since isNetworkAvailableForCrashUploads is implemented by PrivacyPreferencesManager as:

@Override
public boolean isNetworkAvailableForCrashUploads() {
    return isNetworkAvailable() && isWiFiOrEthernetNetwork();
}

I suggest we change the code in MinidumpUploadRetry.onConnectionTypeChanged() to just ask PrivacyPreferencesManager whether the new connection type is enough to upload crash data (instead of just checking that there is a connection at all).


If I haven't uploaded a CL for this on Monday feel free to take this bug Ilya :).
 
Important note: when we fail the step in MinidumpUploadCallable and return UPLOAD_FAILURE, we will interpret that as one attempt (out of three possible attempts) to upload the current minidump - so if we would happen to go on and off a data connection 3 times we lose all our current minidumps (since 3 is our maximum number of upload-tries before abandoning a minidump).
Hah... I looked into this, and apparently the "connectionType" received in MinidumpUploadRetry.onConnectionTypeChanges is of the type ConnectionType (wherever that is defined) while in PrivacyPreferencesManager we deal with connection types as in defined in android.net.ConnectivityManager, so we can't really have a common method for both of these cases (unless we first convert one type to the other).

So, I'm not entirely sure how to write this code so that it doesn't break in the future (fixing this right now is just a question of ensuring that we don't retry uploads when we're not on WiFi/Ethernet).
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1384ca7b54c0a6827e64921a5eccd6c7c84e7391

commit 1384ca7b54c0a6827e64921a5eccd6c7c84e7391
Author: gsennton <gsennton@chromium.org>
Date: Tue Jan 03 21:43:19 2017

[minidump uploader] Retries: only initiate uploads when on WiFi/Ethernet

When re-scheduling minidump uploading in MinidumpUploadRetry we
currently re-try uploading whenever we receive a network-change and the
new connection type is a valid connection. This could result in losing
minidumps if the connection is not of WiFi/Ethernet type since we avoid
uploading minidumps over any other type of connection - and since after
failing to upload a minidump 3 times we abandon the minidump.

BUG= 673097 

Review-Url: https://codereview.chromium.org/2599063002
Cr-Commit-Position: refs/heads/master@{#441213}

[modify] https://crrev.com/1384ca7b54c0a6827e64921a5eccd6c7c84e7391/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadRetry.java
[modify] https://crrev.com/1384ca7b54c0a6827e64921a5eccd6c7c84e7391/chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadService.java
[modify] https://crrev.com/1384ca7b54c0a6827e64921a5eccd6c7c84e7391/chrome/android/javatests/src/org/chromium/chrome/browser/crash/MinidumpUploadServiceTest.java

Status: Fixed (was: Untriaged)

Sign in to add a comment