update_engine: add logs and metrics for libcurl errors
curl_multi_perform may return code that is neither CURLM_OK or
CURLM_CALL_MULTI_PERFORM. When error returns we log them in
update_engine.log and send UMA metrics.
When update_engine does not get http response code from libcurl, we log
internal error code of the libcurl transfer for diagnosis.
Chrome CL to add the metrics enum is here: https://chromium-review.googlesource.com/c/chromium/src/+/1566150
BUG=chromium:927039
TEST=unittest
Change-Id: Ie8ce9dc0a6ce5ff6ffc2ff9425b652d125518558
Reviewed-on: https://chromium-review.googlesource.com/1562172
Commit-Ready: Sean Abraham <seanabraham@chromium.org>
Tested-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 4bbf5a1..34b7bac 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -651,6 +651,7 @@
// Try harder to connect to the network, esp when not interactive.
// See comment in libcurl_http_fetcher.cc.
update_check_fetcher->set_no_network_max_retries(interactive ? 1 : 3);
+ update_check_fetcher->set_is_update_check(true);
auto update_check_action = std::make_unique<OmahaRequestAction>(
system_state_, nullptr, std::move(update_check_fetcher), false);
auto response_handler_action =