mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
tracing: do not attempt to call into JS when disallowed
PR-URL: https://github.com/nodejs/node/pull/32548 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
f0a31e33a8
commit
4e5271acfb
1 file changed
+2
-3
+2
-3
@@ -207,7 +207,7 @@ void InitThreadLocalOnce() {
|
||||
}
|
||||
|
||||
void TrackingTraceStateObserver::UpdateTraceCategoryState() {
|
||||
if (!env_->owns_process_state()) {
|
||||
if (!env_->owns_process_state() || !env_->can_call_into_js()) {
|
||||
// Ideally, we’d have a consistent story that treats all threads/Environment
|
||||
// instances equally here. However, tracing is essentially global, and this
|
||||
// callback is called from whichever thread calls `StartTracing()` or
|
||||
@@ -228,8 +228,7 @@ void TrackingTraceStateObserver::UpdateTraceCategoryState() {
|
||||
TryCatchScope try_catch(env_);
|
||||
try_catch.SetVerbose(true);
|
||||
Local<Value> args[] = {Boolean::New(isolate, async_hooks_enabled)};
|
||||
cb->Call(env_->context(), Undefined(isolate), arraysize(args), args)
|
||||
.ToLocalChecked();
|
||||
USE(cb->Call(env_->context(), Undefined(isolate), arraysize(args), args));
|
||||
}
|
||||
|
||||
static std::atomic<uint64_t> next_thread_id{0};
|
||||
|
||||
Reference in new issue
Block a user