bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

per-app-offline: figure out why DNS sometimes still causes network traffic when offline

RESOLVED FIXED in mozilla36

Status

()

Core
Networking
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jduell, Assigned: valentin)

Tracking

unspecified
mozilla36
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Valentin also observed this.  Not critical because it's so little traffic, but it will cause the phone's network throbber to go off if nothing else, which is confusing (and also possible wake up the radio). So this is something to fix soon.
(Assignee)

Comment 1

4 years ago
http://pastebin.mozilla.org/6266330

The issue seems to be that in nsHttpChannel::BeginConnect, we do a prefetch, regardless of the LOAD_NO_NETWORK_IO or LOAD_ONLY_FROM_CACHE flags being set. (nsHttpChannel.cpp:4613)

I'm looking into a way to fix this.
(Assignee)

Comment 2

4 years ago
Created attachment 8483201 [details] [diff] [review]
nsHttpChannels still do DNSPrefetch when LOAD_NO_NETWORK_IO flag is present
(Assignee)

Comment 3

4 years ago
Comment on attachment 8483201 [details] [diff] [review]
nsHttpChannels still do DNSPrefetch when LOAD_NO_NETWORK_IO flag is present

This seems to get rid of the extra DNS request, but I'm not sure this is correct. Comments?
Attachment #8483201 - Flags: feedback?(mcmanus)
Attachment #8483201 - Flags: feedback?(honzab.moz)
Comment on attachment 8483201 [details] [diff] [review]
nsHttpChannels still do DNSPrefetch when LOAD_NO_NETWORK_IO flag is present

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

::: netwerk/protocol/http/nsHttpChannel.cpp
@@ +4595,5 @@
>      if (mLoadFlags & VALIDATE_ALWAYS || BYPASS_LOCAL_CACHE(mLoadFlags))
>          mCaps |= NS_HTTP_REFRESH_DNS;
>  
> +    if (!mConnectionInfo->UsingHttpProxy() &&
> +        !(mLoadFlags & LOAD_NO_NETWORK_IO)) {

yes.. might as well make it mLoadFlags & (NO_NETWORK_IO | ONLY_FROM_CACHE)

@@ +4614,5 @@
>          mDNSPrefetch->PrefetchHigh(mCaps & NS_HTTP_REFRESH_DNS);
>      }
>  
> +    if (mLoadFlags & LOAD_NO_NETWORK_IO) {
> +        OnLookupComplete(nullptr, nullptr, NS_ERROR_NOT_CONNECTED);

I'm trying to figure out why you did this, and why it's not just the else() clause?

I think all it will accomplish is ~=NS_HTTP_REFRESH_DNS which shouldn't impact the NO_NETWORK_IO case anyhow after your patch...
Attachment #8483201 - Flags: feedback?(mcmanus) → feedback+
Comment on attachment 8483201 [details] [diff] [review]
nsHttpChannels still do DNSPrefetch when LOAD_NO_NETWORK_IO flag is present

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

Yep and I please honor Patrick's comments, I agree with them and don't see a purpose of manual call to OnLookupComplete.
Attachment #8483201 - Flags: feedback?(honzab.moz) → feedback+
(Assignee)

Comment 6

4 years ago
Created attachment 8504306 [details] [diff] [review]
Skip doing a DNSPrefetch when LOAD_NO_NETWORK_IO or ONLY_FROM_CACHE flags are present
Attachment #8504306 - Flags: review?(mcmanus)
(Assignee)

Updated

4 years ago
Attachment #8483201 - Attachment is obsolete: true
Attachment #8504306 - Flags: review?(mcmanus) → review+
https://hg.mozilla.org/mozilla-central/rev/0c905641f867
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.