Commit 14e9c760 authored by Min Qin's avatar Min Qin Committed by Commit Bot

Work around the issue of having duplicate download Id and remove crash dump

We added some logs to analyze the crash, and the newly added crash dump verifies
the issue is caused by duplicate download Ids.
This CL works around the issue by skiping downloads with existing ids, and
reverts the crash dump change. This should only impact canary/dev channel,
and another CL to fix duplicate Id generation is in progress

BUG=898859

Change-Id: Iab5cf36bee1cdb97566872916a6b010d6be2ac3d
Reviewed-on: https://chromium-review.googlesource.com/c/1306241Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603704}
parent d61f09d6
......@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/debug/alias.h"
#include "base/debug/dump_without_crashing.h"
#include "base/i18n/case_conversion.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
......@@ -547,18 +546,12 @@ void DownloadManagerImpl::OnInProgressDownloadManagerInitialized() {
uint32_t max_id = download::DownloadItem::kInvalidId;
for (auto& download : in_progress_downloads) {
DCHECK(!base::ContainsKey(downloads_by_guid_, download->GetGuid()));
// It is problematic to have 2 downloads with the same ID. Log cases that
// this happens (without crashing) to track https://crbug.com/898859. Remove
// this once the issue is fixed.
// If this id is not unique, drop this download, this may happen due to a
// previous history DB failure. See http://crbug.com/898859.
// TODO(qinmin): remove the downloaded files too if wasn't completed.
if (base::ContainsKey(downloads_, download->GetId())) {
static auto* download_id_error = base::debug::AllocateCrashKeyString(
"download_id_error", base::debug::CrashKeySize::Size32);
base::debug::SetCrashKeyString(
download_id_error,
base::StringPrintf(
"id = %d, same_guid = %d", download->GetId(),
download->GetGuid() == downloads_[download->GetId()]->GetGuid()));
base::debug::DumpWithoutCrashing();
in_progress_manager_->RemoveInProgressDownload(download->GetGuid());
continue;
}
uint32_t id = download->GetId();
if (id > max_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment