Skip to content

Conversation

@cola119
Copy link
Member

@cola119cola119 commented Mar 27, 2022

Fixed#41792

When an uncaught exception occurs with inspector enabled, node::errors::TriggerUncaughtException will let an inspector agent send the error report.

report_to_inspector();

After reporting errors, the inspector agent waits for the client to disconnect. But this means the agent stops the following process and shows nothing in stderr.

Ideally, AtExit hook should be responsible for disconnection of inspector and the error reporters should send error information only. An inspector agent has no reason to wait for disconnection since the disconnection process is already registered to AtExit hook.

AtExit(parent_env_, [](void* env){
Agent* agent = static_cast<Environment*>(env)->inspector_agent();
if (agent->IsActive()){
agent->WaitForDisconnect();
}
}, parent_env_);

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol needs-ci PRs that need a full CI run. labels Mar 27, 2022
@RaisinTenRaisinTen requested a review from hybristMarch 27, 2022 07:16
@nodejs-github-bot
Copy link
Collaborator

@hybrist
Copy link
Contributor

I'm not sure if I fully understand the implications of removing WaitForDisconnect here. It seems okay but maybe somebody from @nodejs/v8 or @nodejs/v8-inspector has the full picture?

@nodejs-github-bot
Copy link
Collaborator

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.inspectorIssues and PRs related to the V8 inspector protocolneeds-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntax error not showing in stderr with node --inspect-brk in node 12+

4 participants

@cola119@nodejs-github-bot@hybrist@watilde