Status: Started
Owner:
jay...@chromium.org
CC:
dgarr...@chromium.org,
garn...@chromium.org,
r...@chromium.org,
su...@chromium.org,
gaur...@chromium.org
Labels: Type-Bug Pri-1 Area-Installer Sev-2 Mstone-20 Iteration-55
New issue 30579 by
jay...@chromium.org: Update Engine should check for
downloaded size before checking hash
http://code.google.com/p/chromium-os/issues/detail?id=30579
When investigating Royans' report of AU errors, we found that due to some
reason (to be investigated), our downloads get terminated before the full
payload is downloaded. Sometimes with 0 bytes, sometimes with 1MB instead
of 2MB.
Although we have code to check for size mismatch, that code happens after
the check for hash mismatch. As a result, all size mismatch issues (which
are relatively more common) show up as hash mismatch and make it look
scarier and harder to investigate.
This bug is just for moving the size check before the hash check in the
code below in delta_performer.cc. That's why we see zero count of
kActionCodeDownloadSizeMismatchError (11) errors in the report whereas we
see 2467 counts of kActionCodeDownloadHashMismatchError (10) errors and 255
counts of kActionCodeDownloadPayloadVerificationError (12) errors. If we
move the size check first, then we'll really know which are partial
download issue (which needs to be fixed as a separate bug) and the real
number of hash/payload issues, if any.
// Verifies the download hash.
const string& download_hash_data = hash_calculator_.hash();
TEST_AND_RETURN_VAL(kActionCodeDownloadPayloadVerificationError,
!download_hash_data.empty());
TEST_AND_RETURN_VAL(kActionCodeDownloadHashMismatchError,
download_hash_data == update_check_response_hash);
// Verifies the download size.
TEST_AND_RETURN_VAL(kActionCodeDownloadSizeMismatchError,
update_check_response_size ==
manifest_metadata_size_ + buffer_offset_);