Revert "src: remove trace_sync_io_ from env"
This reverts commit 7fa5f54e6f2854183e45e0e105a1e22a381aac60. The reverted commit breaks the logic behind --trace-sync-io, it should be enabled only at a certain point in time, while that commit enables it from the very start, causing warnings be printed for all sync io instead of sync io after the first tick of the event loop as documented. Fixes: https://github.com/nodejs/node/issues/28913 Refs: https://github.com/nodejs/node/pull/22726 Refs: https://nodejs.org/api/cli.html#cli_trace_sync_io PR-URL: https://github.com/nodejs/node/pull/28926 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
5eaef7b915
commit
aa252ebf66
@ -465,7 +465,7 @@ inline void Environment::set_printed_error(bool value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Environment::set_trace_sync_io(bool value) {
|
inline void Environment::set_trace_sync_io(bool value) {
|
||||||
options_->trace_sync_io = value;
|
trace_sync_io_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool Environment::abort_on_uncaught_exception() const {
|
inline bool Environment::abort_on_uncaught_exception() const {
|
||||||
|
@ -567,7 +567,7 @@ void Environment::StopProfilerIdleNotifier() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Environment::PrintSyncTrace() const {
|
void Environment::PrintSyncTrace() const {
|
||||||
if (!options_->trace_sync_io) return;
|
if (!trace_sync_io_) return;
|
||||||
|
|
||||||
HandleScope handle_scope(isolate());
|
HandleScope handle_scope(isolate());
|
||||||
|
|
||||||
|
@ -1272,6 +1272,7 @@ class Environment : public MemoryRetainer {
|
|||||||
const uint64_t timer_base_;
|
const uint64_t timer_base_;
|
||||||
std::shared_ptr<KVStore> env_vars_;
|
std::shared_ptr<KVStore> env_vars_;
|
||||||
bool printed_error_ = false;
|
bool printed_error_ = false;
|
||||||
|
bool trace_sync_io_ = false;
|
||||||
bool emit_env_nonstring_warning_ = true;
|
bool emit_env_nonstring_warning_ = true;
|
||||||
bool emit_err_name_warning_ = true;
|
bool emit_err_name_warning_ = true;
|
||||||
size_t async_callback_scope_depth_ = 0;
|
size_t async_callback_scope_depth_ = 0;
|
||||||
|
@ -111,6 +111,8 @@ int NodeMainInstance::Run() {
|
|||||||
env->async_hooks()->pop_async_id(1);
|
env->async_hooks()->pop_async_id(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
env->set_trace_sync_io(env->options()->trace_sync_io);
|
||||||
|
|
||||||
{
|
{
|
||||||
SealHandleScope seal(isolate_);
|
SealHandleScope seal(isolate_);
|
||||||
bool more;
|
bool more;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user