src: allow preventing debug signal handler start · nodejs/node@b228db5 · GitHub
Skip to content

Commit b228db5

Browse files
codebyteretargos
authored andcommitted
src: allow preventing debug signal handler start
PR-URL: #46681 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f96466a commit b228db5

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/env-inl.h

Lines changed: 4 additions & 0 deletions

src/env.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ class Environment : public MemoryRetainer {
803803
inline bool tracks_unmanaged_fds() const;
804804
inline bool hide_console_windows() const;
805805
inline bool no_global_search_paths() const;
806+
inline bool should_start_debug_signal_handler() const;
806807
inline bool no_browser_globals() const;
807808
inline uint64_t thread_id() const;
808809
inline worker::Worker* worker_context() const;

src/inspector_agent.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,11 @@ bool Agent::Start(const std::string& path,
717717
StartIoThreadAsyncCallback));
718718
uv_unref(reinterpret_cast<uv_handle_t*>(&start_io_thread_async));
719719
start_io_thread_async.data = this;
720-
// Ignore failure, SIGUSR1 won't work, but that should not block node start.
721-
StartDebugSignalHandler();
720+
if (parent_env_->should_start_debug_signal_handler()) {
721+
// Ignore failure, SIGUSR1 won't work, but that should not block node
722+
// start.
723+
StartDebugSignalHandler();
724+
}
722725

723726
parent_env_->AddCleanupHook([](void* data) {
724727
Environment* env = static_cast<Environment*>(data);

src/node.h

Lines changed: 5 additions & 1 deletion

0 commit comments

Comments
 (0)