NS_ENSURE_SUCCESS(rv, rv) failed with NS_ERROR_NOT_AVAILABLE: file netwerk/cache2/CacheEntry.cpp, line 1151

RESOLVED FIXED in Firefox 52

Status

()

Core
Networking: Cache
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: nbp, Assigned: mayhemer)

Tracking

unspecified
mozilla52
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

(Whiteboard: [necko-active])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

a year ago
Every time the alternate data is not available, NS_ENSURE_SUCCESS produces a warning. This would produce warnings for every load where an alternative data type is preferred, for the first visit and for any script where we are unable to produce alternate data for.

I suggest to manually filter out NS_ERROR_NOT_AVAILABLE before calling NS_ENSURE_SUCCESS.
(Reporter)

Comment 1

a year ago
Created attachment 8795773 [details] [diff] [review]
Explicitly filter out unavailable alternate data type errors.

As unavailable alternate data type is a common, expected, and supported case, we
should not produce a warning for such issues. This patch filters out the
unavailable error before the use of NS_ENSURE_SUCCESS macro.
Attachment #8795773 - Flags: review?(valentin.gosu)
(Assignee)

Updated

a year ago
Assignee: nobody → nicolas.b.pierron
Whiteboard: [necko-active]
Comment on attachment 8795773 [details] [diff] [review]
Explicitly filter out unavailable alternate data type errors.

Review of attachment 8795773 [details] [diff] [review]:
-----------------------------------------------------------------

Honza, is this OK, or are we better off replacing NS_ENSURE with if (NS_FAILED(rv)) return rv?
Attachment #8795773 - Flags: review?(valentin.gosu) → review?(honzab.moz)
(Assignee)

Updated

a year ago
Attachment #8795773 - Flags: review?(honzab.moz)
(Assignee)

Comment 3

a year ago
Failure of call to CacheEntry::OpenAlternativeInputStream with NS_ERROR_NOT_AVAILABLE is legal.  The patch as suggested deletes warnings that we may want to log.  I will take this bug and have a patch that should preserve console warnings in some cases that might be useful to have.
Assignee: nicolas.b.pierron → honzab.moz
Status: NEW → ASSIGNED
(Assignee)

Comment 4

a year ago
Created attachment 8796180 [details] [diff] [review]
v2 (WARNs inside CacheFile::OpenAlternativeInputStream)

Michal, this is what I think is worth to spit to the console, but feel free to suggest changes.
Attachment #8795773 - Attachment is obsolete: true
Attachment #8796180 - Flags: review?(michal.novotny)
Attachment #8796180 - Flags: review?(michal.novotny) → review+
(Assignee)

Comment 5

a year ago
(no need for a try run, this only changes few warning prints to the console)
Keywords: checkin-needed

Comment 6

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/06cb6118fd79
Only fatal console warnings on failures of OpenAlternativeInputStream in HTTP cache. r=michal
Keywords: checkin-needed

Comment 7

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/06cb6118fd79
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.