Repository navigation
inspector: avoid more JS calls from V8 interrupts - #66740
christianaurichzm wants to merge 1 commit into
Conversation
|
Review requested:
|
|
@legendecas @joyeecheung since you reviewed #65397, could you take a look at the re-land when you get a chance? It also needs a node-test-commit-v8-linux run, since that is what caught the futex failure last time. Thanks! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66740 +/- ##
==========================================
- Coverage 92.85% 90.50% -2.35%
==========================================
Files 428 797 +369
Lines 194693 278246 +83553
Branches 30091 53451 +23360
==========================================
+ Hits 180774 251837 +71063
- Misses 13593 16790 +3197
- Partials 326 9619 +9293
🚀 New features to boost your workflow:
|
|
Oh another case found,
Rather than deferring |
|
Note that we are drafting a new policy for updating V8 in Node.js - for V8 commit backports that are justified to be fast tracked and do not have to wait for the regular V8 upgrade, it's better to target release staging branches, instead of main: #66710 |
Inspector messages for a main thread connection are dispatched from a V8 interrupt handler. Defer frontend messages in this case using a microtask. This preserves the existing timing contract for main thread inspector connections, where notifications are observable after a microtask checkpoint. Starting the inspector I/O thread and toggling network tracking can also call into JS from an interrupt. Signed-off-by: deepak1556 <hop2deep@gmail.com> Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
960398c to
3090ade
Compare
|
Thanks @joyeecheung. I dropped the backport and the commit that enables the check. I'll enable it in a separate PR once a V8 update brings in v8/v8@35bd1582fe0a. @deepak1556, you're right about the second case: with a I tried your patch with the check enabled and both cases work. One thing I hit: BindingData* binding_data = realm->GetBindingData<BindingData>();
if (binding_data != nullptr && args[2]->IsBoolean()) {
auto& slot = args[2]->IsTrue() ? binding_data->local_storage
: binding_data->session_storage;
slot = BaseObjectWeakPtr<Storage>(storage);
}If you're OK with that change, I'll add your patch here with you as the author, plus regression tests. |
This lands the Node.js side of #65397, which was reverted in #65907, without enabling the V8 check.
This is @deepak1556's
inspector: defer JS execution from V8 interruptsfrom #65397, unchanged apart from a conflict with #65877. As before, messages for an in-processinspector.Sessionthat arrive while Node.js handles another client's message in an interrupt are delivered at the next microtask checkpoint instead of synchronously.DOMStorage still has paths that can call into JavaScript from an interrupt; the remaining changes are being discussed below. Enabling the check needs v8/v8@35bd1582fe0a, which is in V8 15.8, so that will be a separate PR once
deps/v8includes it.Refs: #65397
Refs: #65907
Refs: #66710