Unhandled promise rejections from within workers sometimes take a long time to show up in the browser console
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: mstange, Unassigned)
References
Details
Steps to reproduce:
- Run the following code in the Browser Console:
var worker = new Worker(URL.createObjectURL(new Blob(["onmessage = async () => { throw new Error('error'); };"])));
// worker.onerror = function(e){ console.error("onerror", e); }; // not called for unhandled promise rejections
worker.postMessage("whaddup");
- Wait for the error to show up in the console.
Expected results:
The error should show up immediately.
Actual results:
Sometimes, around 30 seconds elapse before the error appears in the console.
Removing async
makes the error appear instantly.
Comment 1•5 years ago
|
||
So, the ReportErrorRunnable may be suspended based on debugger stuff which could be involved.
:mstange, can you confirm that Worker.onerror is similarly delayed so that we can separate potential devtools console/UI issues from the lower level error reporting issue?
:bhackett, you've most recently been involved in this area, do you have any thoughts on this?
Reporter | ||
Comment 2•5 years ago
•
|
||
onerror seems not to be called in that case.
I've updated comment 0 with a full testcase that you can run on your own.
Comment 3•5 years ago
|
||
Whoops, I think my brain totally missed the async
the first time. That is indeed different and probably not a regression. Dropping :bhackett's needinfo for now.
Thanks for the update and test-case. It's likely this has a Workers aspect to it, but I'm going to move this to devtools for visibility. I will continue to follow the bug. (And bug 1592584 which I think may be related in terms of how devtools attaches to workers for console purposes... and I'm cc'ing baku since he seemed to volunteer to work on Worker bugs again in that bug ;)
Updated•2 years ago
|
Description
•