From 24246bd5c0e10542c3778e1ef8f8198e3b191756 Mon Sep 17 00:00:00 2001 From: Sandor Molnar Date: Tue, 19 Mar 2024 16:35:37 +0200 Subject: [PATCH] Backed out changeset 72d4f33ccc36 (bug 1884208) for causing assertion failures @ parser/html/nsHtml5StreamParser.cpp --- netwerk/metrics.yaml | 32 ++++++++++++++++++++++ netwerk/protocol/http/HttpChannelChild.cpp | 13 ++++++--- parser/html/nsHtml5StreamParser.cpp | 14 +++++++--- 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/netwerk/metrics.yaml b/netwerk/metrics.yaml index 648dced01e04..641c1500a608 100644 --- a/netwerk/metrics.yaml +++ b/netwerk/metrics.yaml @@ -452,6 +452,22 @@ networking: - rjesup@mozilla.com expires: 130 + http_content_ondatafinished_to_onstop_delay_negative: + type: timing_distribution + time_unit: millisecond + description: > + The time between processing OnStopRequest and processing OnDataFinished (if OnStopRequest comes first) + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1857615 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1857615#c + data_sensitivity: + - technical + notification_emails: + - necko@mozilla.com + - rjesup@mozilla.com + expires: 130 + http_content_html5parser_ondatafinished_to_onstop_delay: type: timing_distribution time_unit: millisecond @@ -468,6 +484,22 @@ networking: - rjesup@mozilla.com expires: 130 + http_content_html5parser_ondatafinished_to_onstop_delay_negative: + type: timing_distribution + time_unit: millisecond + description: > + The time between processing OnStopRequest and processing OnDataFinished (if OnStopRequest comes first) + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1857926 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1857926 + data_sensitivity: + - technical + notification_emails: + - necko@mozilla.com + - rjesup@mozilla.com + expires: 130 + http_content_cssloader_ondatafinished_to_onstop_delay: type: timing_distribution time_unit: millisecond diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index bc83c5c269c4..c7009f34d33c 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -852,10 +852,15 @@ class RecordStopRequestDelta final { } TimeDuration delta = (mOnStopRequestTime - mOnDataFinishedTime); - MOZ_ASSERT((delta.ToMilliseconds() >= 0), - "OnDataFinished after OnStopRequest"); - glean::networking::http_content_ondatafinished_to_onstop_delay - .AccumulateRawDuration(delta); + if (delta.ToMilliseconds() < 0) { + // Because Telemetry can't handle negatives + delta = -delta; + glean::networking::http_content_ondatafinished_to_onstop_delay_negative + .AccumulateRawDuration(delta); + } else { + glean::networking::http_content_ondatafinished_to_onstop_delay + .AccumulateRawDuration(delta); + } } }; diff --git a/parser/html/nsHtml5StreamParser.cpp b/parser/html/nsHtml5StreamParser.cpp index 251ba9f90b8c..82344cfa875c 100644 --- a/parser/html/nsHtml5StreamParser.cpp +++ b/parser/html/nsHtml5StreamParser.cpp @@ -1421,10 +1421,16 @@ nsresult nsHtml5StreamParser::OnStopRequest( } if (!mOnStopRequestTime.IsNull() && !mOnDataFinishedTime.IsNull()) { TimeDuration delta = (mOnStopRequestTime - mOnDataFinishedTime); - MOZ_ASSERT((delta.ToMilliseconds() >= 0), - "OnDataFinished after OnStopRequest"); - glean::networking::http_content_html5parser_ondatafinished_to_onstop_delay - .AccumulateRawDuration(delta); + if (delta.ToMilliseconds() < 0) { + // Because Telemetry can't handle negatives + delta = -delta; + glean::networking:: + http_content_html5parser_ondatafinished_to_onstop_delay_negative + .AccumulateRawDuration(delta); + } else { + glean::networking::http_content_html5parser_ondatafinished_to_onstop_delay + .AccumulateRawDuration(delta); + } } return NS_OK; }