Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: destroy inspector agent before context #16472

Merged
merged 1 commit into from
Oct 25, 2017
Merged

Conversation

ofrobots
Copy link
Contributor

@ofrobots ofrobots commented Oct 25, 2017

The inspector_agent depends on the context still being accessible
during the destructor execution.

Fixes: #15558

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

inspector

CI: https://ci.nodejs.org/job/node-test-pull-request/10954/
https://ci.nodejs.org/job/node-test-pull-request/10969/

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Oct 25, 2017
@mscdex mscdex added the inspector Issues and PRs related to the V8 inspector protocol label Oct 25, 2017
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestions.

src/env.h Outdated
@@ -668,7 +668,7 @@ class Environment {

#if HAVE_INSPECTOR
inline inspector::Agent* inspector_agent() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can be const now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done.

src/env.h Outdated
@@ -713,7 +713,7 @@ class Environment {
std::map<std::string, uint64_t> performance_marks_;

#if HAVE_INSPECTOR
inspector::Agent inspector_agent_;
inspector::Agent* inspector_agent_ = nullptr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make this inspector::Agent* const inspector_agent_;, that way the compiler will complain if someone forgets to assign it in the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

src/env-inl.h Outdated
@@ -347,6 +347,11 @@ inline Environment::Environment(IsolateData* isolate_data,
inline Environment::~Environment() {
v8::HandleScope handle_scope(isolate());

#if HAVE_INSPECTOR
// Destory inspector agent before erasing the context.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Destroy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@eugeneo eugeneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for looking into this.

I did some manual testing and do not anticipate any regressions.

@ofrobots
Copy link
Contributor Author

ofrobots commented Oct 25, 2017

The CI looks green. I am planning to land this later today, i.e. less than 48 hrs after opening the PR, as this is a minor bug fix and that it fixes flakiness issues with inspector tests in the CI.

The inspector_agent depends on the context still being accessible
during the destructor execution.

PR-URL: nodejs#16472
Fixes: nodejs#15558
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@ofrobots
Copy link
Contributor Author

Thanks. Landed as e3503ac.

@ofrobots ofrobots deleted the fix-15558 branch October 25, 2017 23:57
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 26, 2017
The inspector_agent depends on the context still being accessible
during the destructor execution.

PR-URL: nodejs/node#16472
Fixes: nodejs/node#15558
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
The inspector_agent depends on the context still being accessible
during the destructor execution.

PR-URL: #16472
Fixes: #15558
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this pull request Oct 30, 2017
The inspector_agent depends on the context still being accessible
during the destructor execution.

PR-URL: #16472
Fixes: #15558
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this pull request Oct 31, 2017
The inspector_agent depends on the context still being accessible
during the destructor execution.

PR-URL: #16472
Fixes: #15558
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@gibfahn gibfahn mentioned this pull request Oct 31, 2017
addaleax pushed a commit to ayojs/ayo that referenced this pull request Dec 7, 2017
The inspector_agent depends on the context still being accessible
during the destructor execution.

PR-URL: nodejs/node#16472
Fixes: nodejs/node#15558
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Sign up for free to 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++. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows - inspector - intermittent ? - inspector/test-bindings
10 participants