Bug 1138282 - Extend telemetry for large number of SERVICE_STILL_APPLYING_ON_FAILURE errors. r=bbondy

This commit is contained in:
Robert Strong 2015-04-03 11:19:01 -07:00
Родитель 7e1d991895
Коммит 478a8e47e2
3 изменённых файлов: 28 добавлений и 13 удалений

Просмотреть файл

@ -233,11 +233,11 @@ StartUpdateProcess(int argc,
CREATE_DEFAULT_ERROR_MODE,
nullptr,
nullptr, &si, &pi);
// Empty value on putenv is how you remove an env variable in Windows
putenv(const_cast<char*>("MOZ_USING_SERVICE="));
BOOL updateWasSuccessful = FALSE;
if (processStarted) {
BOOL processTerminated = FALSE;
BOOL noProcessExitCode = FALSE;
// Wait for the updater process to finish
LOG(("Process was started... waiting on result."));
DWORD waitRes = WaitForSingleObject(pi.hProcess, TIME_TO_WAIT_ON_UPDATER);
@ -245,6 +245,7 @@ StartUpdateProcess(int argc,
// We waited a long period of time for updater.exe and it never finished
// so kill it.
TerminateProcess(pi.hProcess, 1);
processTerminated = TRUE;
} else {
// Check the return code of updater.exe to make sure we get 0
DWORD returnCode;
@ -254,6 +255,7 @@ StartUpdateProcess(int argc,
updateWasSuccessful = (returnCode == 0);
} else {
LOG_WARN(("Process finished but could not obtain return code."));
noProcessExitCode = TRUE;
}
}
CloseHandle(pi.hProcess);
@ -264,22 +266,27 @@ StartUpdateProcess(int argc,
BOOL isApplying = FALSE;
if (IsStatusApplying(argv[1], isApplying) && isApplying) {
if (updateWasSuccessful) {
LOG(("update.status is still applying even know update "
" was successful."));
LOG(("update.status is still applying even though update was "
"successful."));
if (!WriteStatusFailure(argv[1],
SERVICE_STILL_APPLYING_ON_SUCCESS)) {
LOG_WARN(("Could not write update.status still applying on"
" success error."));
LOG_WARN(("Could not write update.status still applying on "
"success error."));
}
// Since we still had applying we know updater.exe didn't do its
// job correctly.
updateWasSuccessful = FALSE;
} else {
LOG_WARN(("update.status is still applying and update was not successful."));
if (!WriteStatusFailure(argv[1],
SERVICE_STILL_APPLYING_ON_FAILURE)) {
LOG_WARN(("Could not write update.status still applying on"
" success error."));
int failcode = SERVICE_STILL_APPLYING_ON_FAILURE;
if (noProcessExitCode) {
failcode = SERVICE_STILL_APPLYING_NO_EXIT_CODE;
} else if (processTerminated) {
failcode = SERVICE_STILL_APPLYING_TERMINATED;
}
if (!WriteStatusFailure(argv[1], failcode)) {
LOG_WARN(("Could not write update.status still applying on "
"failure error."));
}
}
}
@ -321,6 +328,8 @@ StartUpdateProcess(int argc,
}
}
}
// Empty value on putenv is how you remove an env variable in Windows
putenv(const_cast<char*>("MOZ_USING_SERVICE="));
free(cmdLine);
return updateWasSuccessful;

Просмотреть файл

@ -42,7 +42,7 @@
#define MAR_CHANNEL_MISMATCH_ERROR 22
#define VERSION_DOWNGRADE_ERROR 23
// Error codes 24-33 and 49 are for the Windows maintenance service.
// Error codes 24-33 and 49-51 are for the Windows maintenance service.
#define SERVICE_UPDATER_COULD_NOT_BE_STARTED 24
#define SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS 25
#define SERVICE_UPDATER_SIGN_ERROR 26
@ -67,8 +67,10 @@
#define DELETE_ERROR_EXPECTED_FILE 47
#define RENAME_ERROR_EXPECTED_FILE 48
// Error codes 24-33 and 49 are for the Windows maintenance service.
// Error codes 24-33 and 49-51 are for the Windows maintenance service.
#define SERVICE_COULD_NOT_COPY_UPDATER 49
#define SERVICE_STILL_APPLYING_TERMINATED 50
#define SERVICE_STILL_APPLYING_NO_EXIT_CODE 51
#define WRITE_ERROR_FILE_COPY 61
#define WRITE_ERROR_DELETE_FILE 62

Просмотреть файл

@ -115,6 +115,8 @@ const WRITE_ERROR_ACCESS_DENIED = 35;
const WRITE_ERROR_CALLBACK_APP = 37;
const FILESYSTEM_MOUNT_READWRITE_ERROR = 43;
const SERVICE_COULD_NOT_COPY_UPDATER = 49;
const SERVICE_STILL_APPLYING_TERMINATED = 50;
const SERVICE_STILL_APPLYING_NO_EXIT_CODE = 51;
const WRITE_ERROR_FILE_COPY = 61;
const WRITE_ERROR_DELETE_FILE = 62;
const WRITE_ERROR_OPEN_PATCH_FILE = 63;
@ -152,7 +154,9 @@ const SERVICE_ERRORS = [SERVICE_UPDATER_COULD_NOT_BE_STARTED,
SERVICE_UPDATER_NOT_FIXED_DRIVE,
SERVICE_COULD_NOT_LOCK_UPDATER,
SERVICE_INSTALLDIR_ERROR,
SERVICE_COULD_NOT_COPY_UPDATER];
SERVICE_COULD_NOT_COPY_UPDATER,
SERVICE_STILL_APPLYING_TERMINATED,
SERVICE_STILL_APPLYING_NO_EXIT_CODE];
// Error codes 80 through 99 are reserved for nsUpdateService.js and are not
// defined in common/errors.h