Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse of get_cx can fail after clearing JS runtime #21866
Comments
|
An example of what this looks like:
|
|
Related to #21419, and in general lots of code which assumes browsing contexts are never discarded. |
|
How can I reproduce this on local? |
|
Also, when you mean the global, do you mean all the tasks submitted through GlobalScope.pipeline_id? |
|
You may be lucky enough to be able to trigger this (potentially) intermittent failure by running |
|
Sorry, I have more questions: How can I get a list of such a tasks? I have been taking a look at the |
|
There's no way to get such a list without looking at each use of CommonScriptMsg::Task, as far as I can tell. It shouldn't be necessary to modify any of them, though; we built our task cancellation mechanism that you've been improving to enable this use case - if we use the API that marks all task sources as cancelled then any outstanding tasks for those sources will be ignored. |
|
@AgustinCB Here are a few more pointers, hopefully they're correct and useful:
So the way to think about how this is processed is that:
Hope this helps(and that if changing the ordering really is the fix, it didn't spoil the fun)! |
Using window.get_cx can trigger a script thread panic when it runs as part of a task that affects a global that already had its runtime cleared. We can avoid this by cancelling all outstanding tasks for the global as part of Window::clear_js_runtime.