Closed Bug 1817659 Opened 10 months ago Closed 10 months ago

Network limiter doesn't work

Categories

(DevTools :: Netmonitor, defect, P1)

Firefox 110
defect
Points:
2

Tracking

(firefox-esr102 unaffected, firefox110 wontfix, firefox111 fixed, firefox112 fixed)

RESOLVED FIXED
112 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox110 --- wontfix
firefox111 --- fixed
firefox112 --- fixed

People

(Reporter: guentherhanslphdyt, Assigned: jdescottes)

References

(Depends on 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [webdriver:m6])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0

Steps to reproduce:

  1. Open dev tools
  2. Go to network tab
  3. Select any throttling option that is not "no throttling"
  4. Try to load any web page

Actual results:

The browser acts as if it is completely offline, even when fast speeds are selected (Wi-Fi)

Expected results:

Just slow down the connection, not completely freeze it.

The Bugbug bot thinks this bug should belong to the 'Core::Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking
Product: Firefox → Core

console output:

JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
Handler function threw an exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs :: #isFromCache :: line 1123"  data: no]
Stack: #isFromCache@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:1123:22
#onResponseHeader@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:1021:43
#dispatchActivity@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:537:31
#maybeEmit@resource://devtools/shared/network-observer/NetworkThrottleManager.sys.mjs:259:15
#maybeEmitEvents@resource://devtools/shared/network-observer/NetworkThrottleManager.sys.mjs:228:22
addActivityCallback@resource://devtools/shared/network-observer/NetworkThrottleManager.sys.mjs:203:26
@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:635:37
makeInfallible/<@resource://devtools/shared/DevToolsInfaillibleUtils.sys.mjs:43:22
Line: 1123, column: 0
console.error: ({})
Handler function threw an exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs :: #isFromCache :: line 1123"  data: no]
Stack: #isFromCache@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:1123:22
#onResponseHeader@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:1021:43
#dispatchActivity@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:537:31
#maybeEmit@resource://devtools/shared/network-observer/NetworkThrottleManager.sys.mjs:259:15
#maybeEmitEvents@resource://devtools/shared/network-observer/NetworkThrottleManager.sys.mjs:228:22
addActivityCallback@resource://devtools/shared/network-observer/NetworkThrottleManager.sys.mjs:203:26
@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:635:37
makeInfallible/<@resource://devtools/shared/DevToolsInfaillibleUtils.sys.mjs:43:22
Line: 1123, column: 0
console.error: ({})
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
[Child 16554, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file mozilla-central/toolkit/xre/nsXREDirProvider.cpp:478
[Child 16554, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file mozilla-central/toolkit/xre/nsXREDirProvider.cpp:478
[Child 16554, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file mozilla-central/toolkit/xre/nsXREDirProvider.cpp:478
[Child 16554, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file mozilla-central/toolkit/xre/nsXREDirProvider.cpp:478
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
JavaScript error: resource://devtools/shared/network-observer/NetworkResponseListener.sys.mjs, line 573: NS_ERROR_INVALID_CONTENT_ENCODING: Component returned failure code: 0x804b001b (NS_ERROR_INVALID_CONTENT_ENCODING) [nsIStreamListener.onDataAvailable]
JavaScript error: resource://devtools/shared/network-observer/NetworkObserver.sys.mjs, line 1123: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheInfoChannel.isFromCache]
[Parent 16179, Cache2 I/O] WARNING: 'NS_FAILED(aResult)', file mozilla-central/netwerk/cache2/CacheFile.cpp:661
[Child 16352, Main Thread] WARNING: IPC message 'PSessionStore::Msg_SessionStoreUpdate' discarded: actor cannot send: file mozilla-central/ipc/glue/ProtocolUtils.cpp:504

Assignee: nobody → jdescottes
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Set release status flags based on info from the regressing bug 1790370

Based on https://searchfox.org/mozilla-central/rev/0e3779abe6ad44feb787a295fbb67bc9fe4e927a/netwerk/base/nsICacheInfoChannel.idl#45-50 I was only expecting isFromCache to return undefined or a boolean. Is it expected that the method throws in some cases?

Flags: needinfo?(valentin.gosu)

Looks like this only happens when we set some latency in our throttling configuration (which is the case for all our profiles), but it seems we don't cover this in tests.

Yes, it seems to throw if not called before OnStopRequest. But I'm not sure that's still a proper thing to do.
I filed a bug to change that.

Flags: needinfo?(valentin.gosu)

Thanks! I'll still fix the devtools logic and add proper tests

Severity: -- → S3
Points: --- → 2
Priority: -- → P1
Whiteboard: [webdriver:m6]
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65e50dd3aa71
[devtools] Catch isFromCache exception in network observer r=bomsy
https://hg.mozilla.org/integration/autoland/rev/c2a70384e2be
[devtools] Sort netmonitor test manifest alphabetically r=bomsy
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch

Comment on attachment 9318728 [details]
Bug 1817659 - [devtools] Catch isFromCache exception in network observer

Beta/Release Uplift Approval Request

  • User impact if declined: Using the network throttling feature in the DevTools network monitor or in RDM prevents requests from completing.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): On the implementation side, we are only adding a try catch around a platform call which can sometimes throw.
    We also added missing automated tests to check that our network profiles were working correctly.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9318728 - Flags: approval-mozilla-beta?
Attachment #9318748 - Flags: approval-mozilla-beta?

Comment on attachment 9318728 [details]
Bug 1817659 - [devtools] Catch isFromCache exception in network observer

Approved for 111.0b6

Attachment #9318728 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9318748 [details]
Bug 1817659 - [devtools] Sort netmonitor test manifest alphabetically

Approved for 111.0b6

Attachment #9318748 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Blocks: 1817903
Duplicate of this bug: 1817903
You need to log in before you can comment on or make changes to this bug.