Closed Bug 1306033 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: Networking: Cache, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: nbp, Assigned: mayhemer)

References

Details

(Whiteboard: [necko-active])

Attachments

(1 file, 1 obsolete file)

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.
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: 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)
Attachment #8795773 - Flags: review?(honzab.moz)
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
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+
(no need for a try run, this only changes few warning prints to the console)
Keywords: checkin-needed
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
https://hg.mozilla.org/mozilla-central/rev/06cb6118fd79
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.