Commit 79ec59bb authored by Miriam Gershenson's avatar Miriam Gershenson Committed by Commit Bot

Add histogram to track DNS outcomes after malformed responses

The special error handling for this case is strange and I want to delete
it. This histogram will track how often it's useful so we can decide
whether it's okay to delete.

Bug: 779589
Change-Id: Ieadcb1214486bd468e5e9c18d2f06915b6ee1fff
Reviewed-on: https://chromium-review.googlesource.com/822832Reviewed-by: default avatarJulia Tuttle <juliatuttle@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Miriam Gershenson <mgersh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524188}
parent 0a365af0
...@@ -71,6 +71,26 @@ std::unique_ptr<base::Value> NetLogStartCallback( ...@@ -71,6 +71,26 @@ std::unique_ptr<base::Value> NetLogStartCallback(
return std::move(dict); return std::move(dict);
} }
// Values are used in UMA histograms. Do not change existing values.
enum MalformedResponseResult {
MALFORMED_OK = 0,
MALFORMED_MALFORMED = 1,
MALFORMED_FAILED = 2,
MALFORMED_MAX
};
void RecordMalformedResponseHistogram(int net_error) {
MalformedResponseResult error_type;
if (net_error == OK)
error_type = MALFORMED_OK;
else if (net_error == ERR_DNS_MALFORMED_RESPONSE)
error_type = MALFORMED_MALFORMED;
else
error_type = MALFORMED_FAILED;
UMA_HISTOGRAM_ENUMERATION("Net.DNS.ResultAfterMalformedResponse", error_type,
MALFORMED_MAX);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// A single asynchronous DNS exchange, which consists of sending out a // A single asynchronous DNS exchange, which consists of sending out a
...@@ -205,10 +225,15 @@ class DnsUDPAttempt : public DnsAttempt { ...@@ -205,10 +225,15 @@ class DnsUDPAttempt : public DnsAttempt {
} while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
set_result(rv); set_result(rv);
// If we received a malformed response, and are now waiting for another one, if (received_malformed_response_) {
// indicate to the transaction that the server might be misbehaving. // If we received a malformed response, and are now waiting for another
if (rv == ERR_IO_PENDING && received_malformed_response_) // one, indicate to the transaction that the server might be misbehaving.
return ERR_DNS_MALFORMED_RESPONSE; if (rv == ERR_IO_PENDING)
return ERR_DNS_MALFORMED_RESPONSE;
// This is a new response after the original malformed one.
RecordMalformedResponseHistogram(rv);
}
if (rv == OK) { if (rv == OK) {
DCHECK_EQ(STATE_NONE, next_state_); DCHECK_EQ(STATE_NONE, next_state_);
UMA_HISTOGRAM_LONG_TIMES_100("AsyncDNS.UDPAttemptSuccess", UMA_HISTOGRAM_LONG_TIMES_100("AsyncDNS.UDPAttemptSuccess",
...@@ -263,6 +288,7 @@ class DnsUDPAttempt : public DnsAttempt { ...@@ -263,6 +288,7 @@ class DnsUDPAttempt : public DnsAttempt {
// Our solution is to make another attempt, in case the query truly // Our solution is to make another attempt, in case the query truly
// failed, but keep this attempt alive, in case it was a false alarm. // failed, but keep this attempt alive, in case it was a false alarm.
received_malformed_response_ = true; received_malformed_response_ = true;
RecordMalformedResponseHistogram(ERR_DNS_MALFORMED_RESPONSE);
next_state_ = STATE_READ_RESPONSE; next_state_ = STATE_READ_RESPONSE;
return OK; return OK;
} }
......
...@@ -26465,6 +26465,12 @@ from previous Chrome versions. ...@@ -26465,6 +26465,12 @@ from previous Chrome versions.
</int> </int>
</enum> </enum>
<enum name="MalformedResponseResult">
<int value="0" label="Success"/>
<int value="1" label="Malformed"/>
<int value="2" label="Other failure"/>
</enum>
<enum name="ManagedUserPasswordChange"> <enum name="ManagedUserPasswordChange">
<int value="0" label="OK_MANAGER">Changed in manager session</int> <int value="0" label="OK_MANAGER">Changed in manager session</int>
<int value="1" label="OK_MANGED">Changed in supervised user session</int> <int value="1" label="OK_MANGED">Changed in supervised user session</int>
...@@ -42379,6 +42379,17 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -42379,6 +42379,17 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.DNS.ResultAfterMalformedResponse"
enum="MalformedResponseResult">
<owner>mgersh@chromium.org</owner>
<summary>
When DnsUDPAttempt gets a malformed response, it returns an error but
continues running. This histogram records all attempt outcomes that are
returned to the transaction once a malformed response has been received,
including the original malformed response.
</summary>
</histogram>
<histogram name="Net.DNS.TotalTime" units="ms"> <histogram name="Net.DNS.TotalTime" units="ms">
<owner>mgersh@chromium.org</owner> <owner>mgersh@chromium.org</owner>
<summary> <summary>
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