Skip to content

Commit

Permalink
fixup! src: fix Worker termination when '--inspect-brk' is passed
Browse files Browse the repository at this point in the history
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
  • Loading branch information
daeyeon committed Jul 5, 2024
1 parent 264d531 commit 8cdeef5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ class Environment : public MemoryRetainer {
// the ownership if transferred into the Environment.
void InitializeInspector(
std::unique_ptr<inspector::ParentInspectorHandle> parent_handle);
void WaitForInspectorFrontend();
void WaitForInspectorFrontendByOptions();
#endif

inline size_t async_callback_scope_depth() const;
Expand Down
3 changes: 2 additions & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,9 @@ bool Agent::WaitForConnectByOptions() {
parent_env_->options()->get_debug_options()->EnableBreakFirstLine();
}
client_->waitForFrontend();
return true;
}
return true;
return false;
}

void Agent::StopIfWaitingForConnect() {
Expand Down
4 changes: 2 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ void Environment::InitializeInspector(
}

if (should_wait_for_inspector_frontend()) {
WaitForInspectorFrontend();
WaitForInspectorFrontendByOptions();
}

profiler::StartProfilers(this);
}

void Environment::WaitForInspectorFrontend() {
void Environment::WaitForInspectorFrontendByOptions() {
if (!inspector_agent_->WaitForConnectByOptions()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void Worker::Run() {
Debug(this, "Created Environment for worker with id %llu", thread_id_.id);

#if HAVE_INSPECTOR
this->env_->WaitForInspectorFrontend();
this->env_->WaitForInspectorFrontendByOptions();
#endif
if (is_stopped()) return;
{
Expand Down

0 comments on commit 8cdeef5

Please sign in to comment.